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

wip #252

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

wip #252

Show file tree
Hide file tree
Changes from 1 commit
Commits
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"v-click-outside": "^3.0.1",
"vue": "^2.6.11",
"vue-i18n": "^8.15.5",
"vue-router": "^3.1.6",
"vue-router": "^3.5.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am working on the wallet playground. I want to add some routes, but since it's only for playground mode, I don't want to do it in router.ts, but rather dynamically.

I had to update vue-router to be able to add routes to specific children using addRoute. Maybe there is another way, but also it doesn't hurt to update now, as it is something less for the future :).

There are no breaking changes between 3.1 and 3.5: https://github.com/vuejs/vue-router/blob/dev/CHANGELOG.md#350-2021-01-25 except for a few TS issues, which you can find in this commit.

@sisou @danimoh do you agree with this decision?

"vue-virtual-scroller": "https://github.com/sisou/vue-virtual-scroller#nimiq/build",
"webpack-i18n-tools": "https://github.com/nimiq/webpack-i18n-tools"
},
Expand Down Expand Up @@ -87,4 +87,4 @@
"vue-template-compiler": "^2.6.11"
},
"license": "Apache-2.0"
}
}
7 changes: 4 additions & 3 deletions src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { WELCOME_MODAL_LOCALSTORAGE_KEY, WELCOME_STAKING_MODAL_LOCALSTORAGE_KEY
import { usePwaInstallPrompt } from './composables/usePwaInstallPrompt';
import type { SetupSwapWithKycResult, SWAP_KYC_HANDLER_STORAGE_KEY } from './swap-kyc-handler'; // avoid bundling
import type { RelayServerInfo } from './lib/usdc/OpenGSN';
import { HubApiMock, isPlaygroundEnabled } from './stores/Playground';

export function shouldUseRedirects(ignoreSettings = false): boolean {
if (!ignoreSettings) {
Expand Down Expand Up @@ -125,7 +126,7 @@ hubApi.on(HubApi.RequestType.ONBOARD, async (accounts) => {
processAndStoreAccounts(accounts);

// Open optional Welcome modal, Bitcoin activation modal or USDC activation modal if appropriate.
await new Promise((resolve) => { router.onReady(resolve); });
await new Promise<void>((resolve) => { router.onReady(resolve); });
if (!areOptionalRedirectsAllowed(router.currentRoute)) return;
const welcomeModalAlreadyShown = window.localStorage.getItem(WELCOME_MODAL_LOCALSTORAGE_KEY);
const { requestType } = accounts[0];
Expand Down Expand Up @@ -390,7 +391,7 @@ export async function syncFromHub() {
// for Ledgers USDC would not be enabled automatically on logins and the activation reminder on every app start
// would be annoying for the user.
const { activeAccountInfo } = useAccountStore();
await new Promise((resolve) => { router.onReady(resolve); });
await new Promise<void>((resolve) => { router.onReady(resolve); });
if (
areOptionalRedirectsAllowed(router.currentRoute)
&& activeAccountInfo.value?.type === AccountType.BIP39 // Legacy accounts and Ledgers are not supported.
Expand Down Expand Up @@ -434,7 +435,7 @@ export async function onboard(asRedirect = false) {
// automatically on login), optionally offer to activate it. After activation, the Bitcoin activation modal leads
// into the Welcome modal if not shown yet.
const { activeAccountInfo } = useAccountStore();
await new Promise((resolve) => { router.onReady(resolve); });
await new Promise<void>((resolve) => { router.onReady(resolve); });
if (
areOptionalRedirectsAllowed(router.currentRoute)
&& activeAccountInfo.value
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10792,10 +10792,10 @@ vue-resize@^0.4.5:
resolved "https://registry.yarnpkg.com/vue-resize/-/vue-resize-0.4.5.tgz#4777a23042e3c05620d9cbda01c0b3cc5e32dcea"
integrity sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg==

vue-router@^3.1.6:
version "3.4.9"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.4.9.tgz#c016f42030ae2932f14e4748b39a1d9a0e250e66"
integrity sha512-CGAKWN44RqXW06oC+u4mPgHLQQi2t6vLD/JbGRDAXm0YpMv0bgpKuU5bBd7AvMgfTz9kXVRIWKHqRwGEb8xFkA==
vue-router@^3.5.0:
version "3.6.5"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.6.5.tgz#95847d52b9a7e3f1361cb605c8e6441f202afad8"
integrity sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ==

vue-style-loader@^4.1.0, vue-style-loader@^4.1.3:
version "4.1.3"
Expand Down