diff --git a/changelogs/1.17.6.txt b/changelogs/1.17.6.txt new file mode 100644 index 00000000..e13dfb47 --- /dev/null +++ b/changelogs/1.17.6.txt @@ -0,0 +1 @@ +Bug fixes diff --git a/package-lock.json b/package-lock.json index 667efd1e..739ea2d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mytonwallet", - "version": "1.17.5", + "version": "1.17.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mytonwallet", - "version": "1.17.5", + "version": "1.17.6", "license": "GPL-3.0-or-later", "dependencies": { "@capacitor-mlkit/barcode-scanning": "^5.3.0", diff --git a/package.json b/package.json index 470d4576..5a2cc433 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mytonwallet", - "version": "1.17.5", + "version": "1.17.6", "description": "The most feature-rich web wallet and browser extension for TON – with support of multi-accounts, tokens (jettons), NFT, TON DNS, TON Sites, TON Proxy, and TON Magic.", "main": "index.js", "scripts": { diff --git a/public/electronVersion.txt b/public/electronVersion.txt index ff278344..622f042f 100644 --- a/public/electronVersion.txt +++ b/public/electronVersion.txt @@ -1 +1 @@ -1.17.5 +1.17.6 diff --git a/public/version.txt b/public/version.txt index ff278344..622f042f 100644 --- a/public/version.txt +++ b/public/version.txt @@ -1 +1 @@ -1.17.5 +1.17.6 diff --git a/src/components/settings/Settings.tsx b/src/components/settings/Settings.tsx index 7f90511c..0e9617eb 100644 --- a/src/components/settings/Settings.tsx +++ b/src/components/settings/Settings.tsx @@ -6,6 +6,7 @@ import { getActions, withGlobal } from '../../global'; import { type GlobalState, SettingsState, type UserToken } from '../../global/types'; import { + APP_ENV, APP_NAME, APP_VERSION, IS_CAPACITOR, @@ -16,7 +17,10 @@ import { TELEGRAM_WEB_URL, } from '../../config'; import { - selectAccountSettings, selectCurrentAccountTokens, selectIsHardwareAccount, selectIsPasswordPresent, + selectAccountSettings, + selectCurrentAccountTokens, + selectIsHardwareAccount, + selectIsPasswordPresent, } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; import { getIsNativeBiometricAuthSupported } from '../../util/capacitor'; @@ -479,7 +483,7 @@ function Settings({
- {APP_NAME} {APP_VERSION} + {APP_NAME} {APP_VERSION} {APP_ENV === 'staging' ? 'Beta' : APP_ENV === 'development' ? 'Dev' : undefined}
diff --git a/src/config.ts b/src/config.ts index 22097d90..37879e33 100644 --- a/src/config.ts +++ b/src/config.ts @@ -21,6 +21,7 @@ export const IS_SSE_SUPPORTED = IS_ELECTRON_BUILD || IS_CAPACITOR; export const ELECTRON_HOST_URL = 'https://dumb-host'; export const INACTIVE_MARKER = '[Inactive]'; export const PRODUCTION_URL = 'https://mytonwallet.app'; +export const BETA_URL = 'https://beta.mytonwallet.app'; export const BASE_URL = process.env.BASE_URL; export const STRICTERDOM_ENABLED = DEBUG && !IS_ELECTRON_BUILD; diff --git a/src/electron/utils.ts b/src/electron/utils.ts index 835cff7e..51320313 100644 --- a/src/electron/utils.ts +++ b/src/electron/utils.ts @@ -7,6 +7,9 @@ import { BASE_URL, PRODUCTION_URL } from '../config'; const ALLOWED_URL_ORIGINS = [BASE_URL!, PRODUCTION_URL].map((url) => (new URL(url).origin)); +export let mainWindow: BrowserWindow; // eslint-disable-line import/no-mutable-exports +export const store: Store = new Store(); + export function checkIsWebContentsUrlAllowed(url: string): boolean { if (!app.isPackaged) { return true; @@ -22,15 +25,15 @@ export function checkIsWebContentsUrlAllowed(url: string): boolean { } export const WINDOW_STATE_FILE = 'window-state.json'; +export const FORCE_STORAGE_CAPTURED_SETTINGS_KEY = 'forceStorageCaptured'; export const IS_MAC_OS = process.platform === 'darwin'; export const IS_WINDOWS = process.platform === 'win32'; export const IS_LINUX = process.platform === 'linux'; export const IS_PREVIEW = process.env.IS_PREVIEW === 'true'; export const IS_FIRST_RUN = !fs.existsSync(`${app.getPath('userData')}/${WINDOW_STATE_FILE}`); - -export let mainWindow: BrowserWindow; // eslint-disable-line import/no-mutable-exports -export const store: Store = new Store(); +export const IS_FORCE_STORAGE_CAPTURE_REQUIRED = app.getVersion() === '1.17.6' + && !store.get(FORCE_STORAGE_CAPTURED_SETTINGS_KEY); export function setMainWindow(window: BrowserWindow) { mainWindow = window; diff --git a/src/electron/window.ts b/src/electron/window.ts index 46a5a4a7..1de54630 100644 --- a/src/electron/window.ts +++ b/src/electron/window.ts @@ -6,13 +6,14 @@ import path from 'path'; import { ElectronAction } from './types'; -import { APP_ENV, BASE_URL } from '../config'; +import { APP_ENV, BASE_URL, BETA_URL } from '../config'; import { AUTO_UPDATE_SETTING_KEY, getIsAutoUpdateEnabled, setupAutoUpdates } from './autoUpdates'; import { processDeeplink } from './deeplink'; import { captureStorage, restoreStorage } from './storageUtils'; import tray from './tray'; import { - checkIsWebContentsUrlAllowed, forceQuit, IS_FIRST_RUN, IS_MAC_OS, IS_PREVIEW, IS_WINDOWS, + checkIsWebContentsUrlAllowed, FORCE_STORAGE_CAPTURED_SETTINGS_KEY, forceQuit, + IS_FIRST_RUN, IS_FORCE_STORAGE_CAPTURE_REQUIRED, IS_MAC_OS, IS_PREVIEW, IS_WINDOWS, mainWindow, setMainWindow, store, WINDOW_STATE_FILE, } from './utils'; @@ -88,6 +89,12 @@ export function createWindow() { loadWindowUrl(); } + if (IS_FORCE_STORAGE_CAPTURE_REQUIRED) { + await captureStorage(); + store.set(FORCE_STORAGE_CAPTURED_SETTINGS_KEY, true); + loadWindowUrl(); + } + mainWindow.show(); }); @@ -99,7 +106,11 @@ function loadWindowUrl(): void { mainWindow.loadURL('http://localhost:4321'); mainWindow.webContents.openDevTools(); } else if (getIsAutoUpdateEnabled()) { - mainWindow.loadURL(BASE_URL!); + if (IS_FORCE_STORAGE_CAPTURE_REQUIRED) { + mainWindow.loadURL(BETA_URL); + } else { + mainWindow.loadURL(BASE_URL!); + } } else if (getIsAutoUpdateEnabled() === undefined && IS_FIRST_RUN) { store.set(AUTO_UPDATE_SETTING_KEY, true); mainWindow.loadURL(BASE_URL!);