From 6a6d3856a56d7a67e862e317e65d83557b644ea0 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Mon, 4 Dec 2023 15:00:36 +0000 Subject: [PATCH 1/4] Fix filter of which tokens can view transactions (#4916) --- .../app/src/components/home/profile/AccountTransactions.svelte | 3 ++- frontend/app/src/components/home/profile/Accounts.svelte | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/app/src/components/home/profile/AccountTransactions.svelte b/frontend/app/src/components/home/profile/AccountTransactions.svelte index 0837505e33..0f6b8dbe49 100644 --- a/frontend/app/src/components/home/profile/AccountTransactions.svelte +++ b/frontend/app/src/components/home/profile/AccountTransactions.svelte @@ -34,6 +34,7 @@ $: cryptoLookup = client.cryptoLookup; $: tokenDetails = $cryptoLookup[ledger]; $: nervousSystemLookup = client.nervousSystemLookup; + $: snsLedgers = new Set(Object.values($nervousSystemLookup).filter((ns) => !ns.isNns).map((ns) => ns.ledgerCanisterId)); $: moreAvailable = moreTransactionsAvailable(transationData); $: loading = transationData.kind === "loading" || transationData.kind === "loading_more"; @@ -146,7 +147,7 @@
{$_("cryptoAccount.transactions")}
!["ckbtc", "icp"].includes(t.symbol.toLowerCase())} + filter={(t) => snsLedgers.has(t.ledger)} on:select={ledgerSelected} {ledger} />
diff --git a/frontend/app/src/components/home/profile/Accounts.svelte b/frontend/app/src/components/home/profile/Accounts.svelte index e246f6bf7e..0ad7f8089f 100644 --- a/frontend/app/src/components/home/profile/Accounts.svelte +++ b/frontend/app/src/components/home/profile/Accounts.svelte @@ -36,7 +36,7 @@ $: cryptoBalance = client.cryptoBalance; $: accounts = buildAccountsList($cryptoLookup, $cryptoBalance); $: nervousSystemLookup = client.nervousSystemLookup; - $: snsLedgers = new Set(Object.values($nervousSystemLookup).map((ns) => ns.ledgerCanisterId)); + $: snsLedgers = new Set(Object.values($nervousSystemLookup).filter((ns) => !ns.isNns).map((ns) => ns.ledgerCanisterId)); $: { zeroCount = accounts.filter((a) => a.zero).length; From e49decc79640d5172491cab6933adc53dd88de38 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Mon, 4 Dec 2023 15:04:39 +0000 Subject: [PATCH 2/4] Fix `earliestAvailableEventIndex` to work with channels (#4912) --- frontend/openchat-client/src/openchat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/openchat-client/src/openchat.ts b/frontend/openchat-client/src/openchat.ts index 4a55a0115e..433ade6946 100644 --- a/frontend/openchat-client/src/openchat.ts +++ b/frontend/openchat-client/src/openchat.ts @@ -2523,7 +2523,7 @@ export class OpenChat extends OpenChatAgentWorker { } earliestAvailableEventIndex(chat: ChatSummary): number { - return chat.kind === "group_chat" ? chat.minVisibleEventIndex : 0; + return chat.kind === "direct_chat" ? 0 : chat.minVisibleEventIndex; } private earliestLoadedIndex(chatId: ChatIdentifier): number | undefined { From eef7a9aee4ccaeb9b599679bc1097879c630fe90 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Mon, 4 Dec 2023 15:08:54 +0000 Subject: [PATCH 3/4] Add all suspended users to store on first load (#4911) --- frontend/openchat-client/src/stores/user.ts | 24 ++++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/openchat-client/src/stores/user.ts b/frontend/openchat-client/src/stores/user.ts index e2ea50da08..8d48550687 100644 --- a/frontend/openchat-client/src/stores/user.ts +++ b/frontend/openchat-client/src/stores/user.ts @@ -73,7 +73,10 @@ export function overwriteUser(lookup: UserLookup, user: UserSummary): UserLookup export const userStore = { subscribe: allUsers.subscribe, - set: (users: UserLookup): void => normalUsers.set(users), + set: (users: UserLookup): void => { + normalUsers.set(users); + addSuspendedUsersToStore(Object.values(users)); + }, add: (user: UserSummary): void => { normalUsers.update((users) => { const clone = { ...users }; @@ -88,13 +91,7 @@ export const userStore = { const clone = { ...users }; return newUsers.reduce((lookup, user) => overwriteUser(lookup, user), clone); }); - const suspended = newUsers.reduce((arr, user) => { - if (user.suspended) { - arr.push(user.userId); - } - return arr; - }, [] as string[]); - suspendedUsers.addMany(suspended); + addSuspendedUsersToStore(newUsers); }, setUpdated: (userIds: string[], timestamp: bigint): void => { normalUsers.update((users) => { @@ -122,3 +119,14 @@ export const platformModerator = derived( currentUser, ($currentUser) => $currentUser.isPlatformModerator, ); + +function addSuspendedUsersToStore(users: UserSummary[]) { + const suspended = users.reduce((arr, user) => { + if (user.suspended) { + arr.push(user.userId); + } + return arr; + }, [] as string[]); + + suspendedUsers.addMany(suspended); +} From 4cfd47e2fff1567ba6818e3374b9afa784644331 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Mon, 4 Dec 2023 15:16:59 +0000 Subject: [PATCH 4/4] Bump DFX to 0.15.2 (#4913) --- dfx.json | 2 +- scripts/proposals/upgrade_asset_canister.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dfx.json b/dfx.json index f875d2a978..887fa2dd0c 100644 --- a/dfx.json +++ b/dfx.json @@ -1,5 +1,5 @@ { - "dfx": "0.15.1", + "dfx": "0.15.2", "canisters": { "user_index": { "type": "custom", diff --git a/scripts/proposals/upgrade_asset_canister.sh b/scripts/proposals/upgrade_asset_canister.sh index 88cc82781c..f515306944 100755 --- a/scripts/proposals/upgrade_asset_canister.sh +++ b/scripts/proposals/upgrade_asset_canister.sh @@ -5,10 +5,10 @@ SCRIPT=$(readlink -f "$0") SCRIPT_DIR=$(dirname "$SCRIPT") cd $SCRIPT_DIR/../.. -TITLE="Upgrade asset canister to DFX version 0.15.0" -URL="https://github.com/dfinity/sdk/releases/tag/0.15.0" +TITLE="Upgrade asset canister to DFX version 0.15.2" +URL="https://github.com/dfinity/sdk/releases/tag/0.15.2" CANISTER_NAME=website -SUMMARY="This proposal upgrades the asset canister wasm to the version included in DFX 0.15.0" +SUMMARY="This proposal upgrades the asset canister wasm to the version included in DFX 0.15.2" FUNCTION_ID=3 # Set env variables based on .env file