@applicaster/zapp-react-dom-app 16.0.0-rc.123 → 16.0.0-rc.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -146,6 +146,35 @@ describe("InteractionManager (web)", () => {
146
146
  });
147
147
  });
148
148
 
149
+ describe("Back at Home on VIDAA", () => {
150
+ it("shows the exit dialog and closes the window on confirm", () => {
151
+ const navigator = window.navigator;
152
+ const close = window.close;
153
+ window.close = jest.fn();
154
+
155
+ (window as any).navigator = {
156
+ userAgent: "Mozilla/5.0 Model/Hisense-MT9602 VIDAA/5.0",
157
+ };
158
+
159
+ const { manager } = createManager({
160
+ backToTopAction: jest.fn(() => "PLATFORM_TO_BACKGROUND"),
161
+ });
162
+
163
+ manager.onBackPress(createBackEvent());
164
+
165
+ expect(showConfirmationDialog).toHaveBeenCalledTimes(1);
166
+
167
+ (
168
+ showConfirmationDialog as jest.Mock
169
+ ).mock.calls[0][0].confirmCompletion();
170
+
171
+ expect(window.close).toHaveBeenCalledTimes(1);
172
+
173
+ (window as any).navigator = navigator;
174
+ window.close = close;
175
+ });
176
+ });
177
+
149
178
  describe("Forward / Rewind keys", () => {
150
179
  const POSITION = 100;
151
180
 
@@ -52,6 +52,7 @@ import { KeyboardLongPressManager } from "@applicaster/zapp-react-dom-ui-compone
52
52
  import { KeyInputHandler } from "@applicaster/zapp-react-native-utils/appUtils/keyInputHandler/KeyInputHandler";
53
53
  import { getHomeRiver } from "@applicaster/zapp-react-native-utils/reactHooks/state";
54
54
  import { withBackToTopActionHOC } from "./hoc";
55
+ import { isVidaaPlatform } from "../Loader/utils/platform";
55
56
 
56
57
  const { withXray } = getXray();
57
58
  const globalAny: any = global;
@@ -252,6 +253,10 @@ export class InteractionManagerClass extends React.Component<Props, State> {
252
253
  if (isVizioPlatform()) {
253
254
  window?.VIZIO?.exitApplication();
254
255
  }
256
+
257
+ if (isVidaaPlatform()) {
258
+ window.close();
259
+ }
255
260
  }
256
261
 
257
262
  handleWebOsBack() {
@@ -279,7 +284,7 @@ export class InteractionManagerClass extends React.Component<Props, State> {
279
284
  platformToBackground() {
280
285
  try {
281
286
  // TODO: temporary hack until this code is refactored
282
- if (isSamsungPlatform() || isVizioPlatform()) {
287
+ if (isSamsungPlatform() || isVizioPlatform() || isVidaaPlatform()) {
283
288
  const { isDialogVisible } = confirmationDialogStore.getState();
284
289
 
285
290
  if (isDialogVisible) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-dom-app",
3
- "version": "16.0.0-rc.123",
3
+ "version": "16.0.0-rc.124",
4
4
  "description": "Zapp App Component for Applicaster's Quick Brick React Native App",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "homepage": "https://github.com/applicaster/zapp-react-dom-app#readme",
24
24
  "dependencies": {
25
- "@applicaster/zapp-react-dom-ui-components": "16.0.0-rc.123",
26
- "@applicaster/zapp-react-native-bridge": "16.0.0-rc.123",
27
- "@applicaster/zapp-react-native-redux": "16.0.0-rc.123",
28
- "@applicaster/zapp-react-native-ui-components": "16.0.0-rc.123",
29
- "@applicaster/zapp-react-native-utils": "16.0.0-rc.123",
25
+ "@applicaster/zapp-react-dom-ui-components": "16.0.0-rc.124",
26
+ "@applicaster/zapp-react-native-bridge": "16.0.0-rc.124",
27
+ "@applicaster/zapp-react-native-redux": "16.0.0-rc.124",
28
+ "@applicaster/zapp-react-native-ui-components": "16.0.0-rc.124",
29
+ "@applicaster/zapp-react-native-utils": "16.0.0-rc.124",
30
30
  "abortcontroller-polyfill": "^1.7.5",
31
31
  "typeface-montserrat": "^0.0.54",
32
32
  "video.js": "7.14.3",