Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRO Dashboard #40

Merged
merged 34 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b51afbd
fix: pro subscription state integrated to the banner, columns choose …
siandreev Feb 29, 2024
568c0c7
fix: tg oauth integrated
siandreev Mar 1, 2024
8de65b9
Merge branch 'feature/pro' into feature/pro-dashboard
siandreev Mar 1, 2024
0d05000
Merge branch 'main' into feature/pro-dashboard
KuznetsovNikita Mar 5, 2024
4e063d0
Fix rebase
KuznetsovNikita Mar 5, 2024
1d71837
Merge branch 'main' into feature/pro-dashboard
siandreev Mar 6, 2024
f1c52fc
Merge remote-tracking branch 'origin/feature/pro-dashboard' into feat…
siandreev Mar 6, 2024
329637c
feat: dashboard api integrated
siandreev Mar 7, 2024
cb42b79
fix: telegram-widget script moved to a separate file
siandreev Mar 7, 2024
ebb4cf9
fix: trial & auth updates
siandreev Mar 8, 2024
c67bc53
chore: locales update
siandreev Mar 8, 2024
2771464
fix: updating from trial to pro
siandreev Mar 8, 2024
20abca3
fix: ton connect modal desktop view; Swap manifest.url and manifest.n…
siandreev Mar 8, 2024
6881592
fix: trial start notification (modal) added
siandreev Mar 8, 2024
80a8801
Merge branch 'main' into feature/pro-dashboard
siandreev Mar 8, 2024
10b4f39
chore: change telegram-oauth filename
siandreev Mar 8, 2024
ab64003
fix: start trial modal i18n translations added
siandreev Mar 8, 2024
f05ebca
chore: i18n update
siandreev Mar 8, 2024
9c68a94
Add REACT_APP_TG_BOT_ID to CI
KuznetsovNikita Mar 11, 2024
3bc8f20
Update version
KuznetsovNikita Mar 11, 2024
93f1a1d
chore: pipeline env vars added
siandreev Mar 11, 2024
0a62297
Merge remote-tracking branch 'origin/feature/pro-dashboard' into feat…
siandreev Mar 11, 2024
871bd1e
chore: pipeline env vars added
siandreev Mar 11, 2024
6150e13
Show menu bar
KuznetsovNikita Mar 11, 2024
a97e9e8
fix: ton connect modal didn't open in dashboard page
siandreev Mar 11, 2024
05c89f4
fix: locales update
siandreev Mar 11, 2024
33c948e
Merge remote-tracking branch 'origin/feature/pro-dashboard' into feat…
siandreev Mar 11, 2024
8702053
fix: dashboard skeleton added
siandreev Mar 11, 2024
87718e3
fix: dashboard wallets filtered, only mainnet are shown
siandreev Mar 11, 2024
fd4b1f2
feat: emoji picker added
siandreev Mar 11, 2024
848c97c
feat: custom emojis added
siandreev Mar 11, 2024
3aabacd
feat: emojis added to all layouts that includes wallet.name
siandreev Mar 12, 2024
a2bdd2e
fix: aside menu bottom maid sticky. tg -> ton_proof Auth fixes
siandreev Mar 12, 2024
fcbd946
Remove zoom factor
KuznetsovNikita Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/desktop/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const langs = 'en,zh_CN,ru,it,tr';
const listOfAuth: AuthState['kind'][] = ['keychain'];

declare const REACT_APP_TONCONSOLE_API: string;
declare const REACT_APP_TG_BOT_ID: string;

export const App = () => {
const { t, i18n } = useTranslation();
Expand Down Expand Up @@ -262,7 +263,10 @@ export const Loader: FC = () => {
standalone: true,
extension: false,
proFeatures: true,
ios: false
ios: false,
env: {
tgAuthBotId: REACT_APP_TG_BOT_ID
}
};

return (
Expand Down
32 changes: 25 additions & 7 deletions apps/desktop/src/electron/mainWindow.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { delay } from '@tonkeeper/core/dist/utils/common';
import { BrowserWindow, ipcMain } from 'electron';
import { BrowserWindow, ipcMain, shell } from 'electron';
import isDev from 'electron-is-dev';
import path from 'path';
import { Cookie, CookieJar } from 'tough-cookie';
Expand All @@ -20,7 +20,7 @@ export abstract class MainWindow {
static mainWindow: BrowserWindow | undefined = undefined;

static async openMainWindow() {
if (this.mainWindow != undefined) return this.mainWindow;
if (this.mainWindow !== undefined) return this.mainWindow;

const icon = (() => {
switch (process.platform) {
Expand All @@ -43,7 +43,7 @@ export abstract class MainWindow {
height: 700,
minHeight: 600,
resizable: isDev,
autoHideMenuBar: process.platform != 'darwin',
autoHideMenuBar: process.platform !== 'darwin',
webPreferences: {
zoomFactor: process.platform !== 'linux' ? 0.8 : undefined,
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY
Expand Down Expand Up @@ -80,11 +80,20 @@ export abstract class MainWindow {
}
const result = cookies
.map(cookie => `${cookie.key}=${cookie.value}`)
.join(', ');
.join('; ');

/* patch tg auth headers */
if (details.url === 'https://oauth.telegram.org/auth/get') {
details.requestHeaders.origin = 'https://tonkeeper.com';
details.requestHeaders.referer = 'https://tonkeeper.com';
}

callback({
requestHeaders: Object.assign(details.requestHeaders, {
...details,
requestHeaders: {
...details.requestHeaders,
cookie: result
})
}
});
});
}
Expand All @@ -93,12 +102,21 @@ export abstract class MainWindow {
this.mainWindow.webContents.session.webRequest.onHeadersReceived((details, callback) => {
const setCookie = details.responseHeaders['set-cookie'] ?? [];

/* patch tg auth headers cors */
if (details.url === 'https://oauth.telegram.org/auth/get') {
const corsHeader =
Object.keys(details.responseHeaders).find(
k => k.toLowerCase() === 'access-control-allow-origin'
) || 'access-control-allow-origin';
details.responseHeaders[corsHeader] = ['*'];
}

Promise.all(
setCookie.map(cookieRaw =>
cookieJar.setCookie(Cookie.parse(cookieRaw), details.url)
)
).finally(() => {
callback({});
callback(details);
});
});

Expand Down
Loading
Loading