Skip to content

Commit

Permalink
v1.17.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Dec 27, 2023
1 parent 2684381 commit 274bc16
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 13 deletions.
1 change: 1 addition & 0 deletions changelogs/1.17.6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bug fixes
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion public/electronVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.5
1.17.6
2 changes: 1 addition & 1 deletion public/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.5
1.17.6
8 changes: 6 additions & 2 deletions src/components/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
Expand Down Expand Up @@ -479,7 +483,7 @@ function Settings({
</div>

<div className={styles.version} onClick={handleMultipleClick}>
{APP_NAME} {APP_VERSION}
{APP_NAME} {APP_VERSION} {APP_ENV === 'staging' ? 'Beta' : APP_ENV === 'development' ? 'Dev' : undefined}
</div>
</div>
<SettingsDeveloperOptions isOpen={isDeveloperModalOpen} onClose={closeDeveloperModal} isTestnet={isTestnet} />
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions src/electron/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
17 changes: 14 additions & 3 deletions src/electron/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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();
});

Expand All @@ -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!);
Expand Down

0 comments on commit 274bc16

Please sign in to comment.