Skip to content

Commit

Permalink
Merge pull request #90 from getamis/ASL-5063/removed-incognito-hint
Browse files Browse the repository at this point in the history
[ASL-5063] Removed incognito detective
  • Loading branch information
VANITAX authored Feb 26, 2024
2 parents b10a1ef + 3218369 commit 5811284
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 69 deletions.
1 change: 0 additions & 1 deletion packages/detect-iab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@ethersproject/providers": "^5.6.8",
"@qubic-js/detect-inapp": "^1.4.1",
"clsx": "^1.1.1",
"detectincognitojs": "^1.3.0",
"jss": "^10.9.0",
"jss-preset-default": "^10.9.0",
"preact": "^10.8.2"
Expand Down
45 changes: 0 additions & 45 deletions packages/detect-iab/src/LeaveIncognitoBrowserModal.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/detect-iab/src/constant.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export const LEAVE_IAB_MODAL_ID = 'qubic-connect-leave-iab-modal';
export const LEAVE_INCOGNITO_MODAL_ID = 'qubic-connect-leave-incognito-modal';
13 changes: 1 addition & 12 deletions packages/detect-iab/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
import InApp from '@qubic-js/detect-inapp';
import { render } from 'preact';
import { detectIncognito } from 'detectincognitojs';
import { LEAVE_IAB_MODAL_ID, LEAVE_INCOGNITO_MODAL_ID } from './constant';
import { LEAVE_IAB_MODAL_ID } from './constant';
import LeaveInAppBrowserModal, { ShowBlockerOptions } from './LeaveInAppBrowserModal';
import LeaveIncognitoBrowserModal from './LeaveIncognitoBrowserModal';

export async function showBlockerWhenIab(options?: ShowBlockerOptions): Promise<void> {
const incognitoResult = typeof window !== 'undefined' ? await detectIncognito() : null;

if (incognitoResult && incognitoResult.isPrivate && !document.getElementById(LEAVE_INCOGNITO_MODAL_ID)) {
const createdRootDiv = document.createElement('div');
document.body.appendChild(createdRootDiv);

render(<LeaveIncognitoBrowserModal browserName={incognitoResult.browserName} />, createdRootDiv);
return;
}
const inapp = new InApp(navigator.userAgent || navigator.vendor || (window as any).opera);

if (inapp.isInApp && !document.getElementById(LEAVE_IAB_MODAL_ID)) {
Expand Down
7 changes: 2 additions & 5 deletions packages/detect-iab/src/locale.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const en = {
alertIabSentence1: 'You are using an in-app browser.',
alertIabSentence2: 'Some functions will be affected. To have a better experience, tap “⋯” and choose “open in system browser”.',
alertIncognitoSentence1: 'You are now in private browsing mode',
alertIncognitoSentence2: 'To have a better experience, open the website in normal browsing mode.',
alertIabSentence2:
'Some functions will be affected. To have a better experience, tap “⋯” and choose “open in system browser”.',
hintPart1: 'Tap "',
hintPart2: '" and choose "',
hintPart3: '".',
Expand All @@ -19,8 +18,6 @@ const en = {
const zhTW = {
alertIabSentence1: '您正在使用其他應用程式的瀏覽器',
alertIabSentence2: '可能會影響部分功能,為了享有更完整的服務,請點擊「⋯」,並選擇「 以瀏覽器開啟」。',
alertIncognitoSentence1: '您正在使用私密瀏覽模式',
alertIncognitoSentence2: '為了享有更完整的服務,請在瀏覽器以一般模式開啟網頁',
hintPart1: '點擊「',
hintPart2: '」,並選擇「',
hintPart3: '」',
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6742,11 +6742,6 @@ detect-port-alt@^1.1.6:
address "^1.0.1"
debug "^2.6.0"

detectincognitojs@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/detectincognitojs/-/detectincognitojs-1.3.0.tgz#6a1338f395c03e06f59e3cf42453e95c96980531"
integrity sha512-/uAMG+6Ipa8izluYQ45HqARjeYgtJLLBvpAiX1Zd3zWJ1MhEne6FDSjkkLaC3pdNeHfT3qhpvFRqB6dwLbdnng==

detective@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.1.tgz#6af01eeda11015acb0e73f933242b70f24f91034"
Expand Down

0 comments on commit 5811284

Please sign in to comment.