Skip to content

Commit 8723eb6

Browse files
committed
feat(sdk): activated / deactivated events do not exist in telegram
1 parent 35b5ad4 commit 8723eb6

File tree

5 files changed

+10
-96
lines changed

5 files changed

+10
-96
lines changed

packages/sdk/src/scopes/components/viewport/exports.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ export {
1717
requestFullscreen,
1818
changeFullscreenPromise,
1919
changeFullscreenError,
20-
onActivated,
21-
offActivated,
22-
onDeactivated,
23-
offDeactivated,
2420
state as viewportState,
2521
stableHeight as viewportStableHeight,
2622
unmount as unmountViewport,

packages/sdk/src/scopes/components/viewport/exports.variable.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
export { requestFullscreen } from './methods/fullscreen/requestFullscreen.js';
22
export { exitFullscreen } from './methods/fullscreen/exitFullscreen.js';
3-
export { onActivated, offActivated } from './methods/visibility/onActivated.js';
4-
export { onDeactivated, offDeactivated } from './methods/visibility/onDeactivated.js';
53
export { mount } from './methods/mounting/mount.js';
64
export { unmount } from './methods/mounting/unmount.js';
75
export { bindCssVars } from './methods/bindCssVars.js';

packages/sdk/src/scopes/components/viewport/methods/mounting/mount.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { mount } from '@/scopes/components/viewport/methods/mounting/mount.js';
1010
import { isMounted } from '@/scopes/components/viewport/signals/mounting.js';
1111
import { isFullscreen } from '@/scopes/components/viewport/signals/fullscreen.js';
1212
import { isExpanded } from '@/scopes/components/viewport/signals/flags.js';
13+
import { isVisible } from '@/scopes/components/viewport/signals/visibility.js';
1314
import { $version } from '@/scopes/globals.js';
1415
import { state } from '@/scopes/components/viewport/signals/state.js';
1516

@@ -89,6 +90,15 @@ describe('is safe', () => {
8990
expect(spy).toHaveBeenCalledWith('tapps/viewport');
9091
expect(isExpanded()).toBe(true);
9192
});
93+
94+
it('should set isVisible true if session storage key "tapps/viewport" is not present', async () => {
95+
const spy = mockSessionStorageGetItem(() => null);
96+
97+
await mount();
98+
expect(spy).toHaveBeenCalledTimes(1);
99+
expect(spy).toHaveBeenCalledWith('tapps/viewport');
100+
expect(isVisible()).toBe(true);
101+
});
92102
});
93103

94104
describe('first launch', () => {

packages/sdk/src/scopes/components/viewport/methods/visibility/onActivated.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/sdk/src/scopes/components/viewport/methods/visibility/onDeactivated.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)