diff --git a/proposals/proposal-271.sh b/proposals/proposal-274.sh similarity index 71% rename from proposals/proposal-271.sh rename to proposals/proposal-274.sh index 81d3577..c6966b8 100755 --- a/proposals/proposal-271.sh +++ b/proposals/proposal-274.sh @@ -6,13 +6,13 @@ source "$(pwd)"/proposals/env.sh # build and get batch_id, evidence: # dfx deploy ic_message_frontend --ic --by-proposal -export BLOB="$(didc encode --format blob '(record {batch_id=44:nat; evidence=blob "\bf\ef\6d\20\99\de\7e\7c\ea\a5\0e\08\96\67\d0\a0\40\ff\44\c3\c3\5b\fa\ef\85\2f\72\ac\26\76\bf\2b"})')" +export BLOB="$(didc encode --format blob '(record {batch_id=46:nat; evidence=blob "\79\f7\db\d0\09\00\1e\e1\d5\39\b2\60\fb\80\40\bc\3b\34\16\37\9b\9c\02\6b\aa\09\97\19\f4\f0\c2\6b"})')" quill sns make-proposal --canister-ids-file ./sns_canister_ids.json --pem-file $PROPOSAL_PEM_FILE $PROPOSAL_NEURON_ID --proposal "( record { - title = \"Execute commit_proposed_batch() to release ic_message_frontend v2.9.2\"; + title = \"Execute commit_proposed_batch() to release ic_message_frontend v2.9.4\"; url = \"https://dMsg.net/\"; - summary = \"This proposal executes commit_proposed_batch() on 2fvu6-tqaaa-aaaap-akksa-cai to release ic_message_frontend v2.9.2.\n\n1. fix: try to fix sign in issue on mobile.\"; + summary = \"This proposal executes commit_proposed_batch() on 2fvu6-tqaaa-aaaap-akksa-cai to release ic_message_frontend v2.9.4.\n\n1. fix: try to fix sign in issue on mobile.\"; action = opt variant { ExecuteGenericNervousSystemFunction = record { function_id = 1100 : nat64; @@ -22,4 +22,4 @@ quill sns make-proposal --canister-ids-file ./sns_canister_ids.json --pem-file $ } )" > proposal-message.json -quill send proposal-message.json +# quill send proposal-message.json diff --git a/src/ic_message_frontend/package.json b/src/ic_message_frontend/package.json index 1cf599b..a1a8e71 100644 --- a/src/ic_message_frontend/package.json +++ b/src/ic_message_frontend/package.json @@ -84,5 +84,5 @@ "test": "vitest run" }, "type": "module", - "version": "2.9.2" + "version": "2.9.4" } \ No newline at end of file diff --git a/src/ic_message_frontend/src/lib/constants.ts b/src/ic_message_frontend/src/lib/constants.ts index db8aee0..8095d73 100644 --- a/src/ic_message_frontend/src/lib/constants.ts +++ b/src/ic_message_frontend/src/lib/constants.ts @@ -1,6 +1,6 @@ const src = globalThis.location?.href || '' -export const APP_VERSION = '2.9.2' +export const APP_VERSION = '2.9.4' export const IS_LOCAL = src.includes('localhost') || src.includes('127.0.0.1') export const ENV = IS_LOCAL ? 'local' : 'ic' export const APP_ORIGIN = IS_LOCAL diff --git a/src/ic_message_frontend/src/lib/stores/auth.ts b/src/ic_message_frontend/src/lib/stores/auth.ts index 3e38e12..8a50dcb 100644 --- a/src/ic_message_frontend/src/lib/stores/auth.ts +++ b/src/ic_message_frontend/src/lib/stores/auth.ts @@ -13,6 +13,7 @@ import { setNameIdentity } from '$lib/utils/auth' import { encodeCBOR, toArrayBuffer } from '$lib/utils/crypto' +import { popupCenter } from '$lib/utils/window' import type { DerEncodedPublicKey, Identity, Signature } from '@dfinity/agent' import { Delegation, @@ -54,6 +55,7 @@ export interface AuthStore extends Readable { } function initAuthStore(): AuthStore { + const authClientPromise = createAuthClient() let identity: IdentityEx | null = null let srcIdentity: IdentityEx | null = null // srcAgent is used to sign in with username @@ -151,10 +153,12 @@ function initAuthStore(): AuthStore { window.location.assign('/_/messages') }, - signIn: async () => { - const authClient = await createAuthClient() - return new Promise((resolve, reject) => { - authClient.login({ + signIn: () => + new Promise(async (resolve, reject) => { + // Important: authClientPromise should be resolved here + // https://ffan0811.medium.com/window-open-returns-null-in-safari-and-firefox-after-allowing-pop-up-on-the-browser-4e4e45e7d926 + const authClient = await authClientPromise + await authClient.login({ derivationOrigin: DERIVATION_ORIGIN as string, maxTimeToLive: BigInt(EXPIRATION_MS) * 1000000n, onSuccess: () => { @@ -176,10 +180,13 @@ function initAuthStore(): AuthStore { console.error(err) reject(err) }, - identityProvider: IDENTITY_PROVIDER + identityProvider: IDENTITY_PROVIDER, + windowOpenerFeatures: popupCenter({ + width: 576, + height: 625 + }) }) - }) - }, + }), logout: async (url: string) => { dynAgent.setIdentity(anonymousIdentity)