Skip to content

Commit

Permalink
Merge branch 'master' into prize_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Dec 4, 2023
2 parents f028ba3 + 4cfd47e commit 7d457c2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dfx.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dfx": "0.15.1",
"dfx": "0.15.2",
"canisters": {
"user_index": {
"type": "custom",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
$: cryptoLookup = client.cryptoLookup;
$: tokenDetails = $cryptoLookup[ledger];
$: nervousSystemLookup = client.nervousSystemLookup;
$: snsLedgers = new Set<string>(Object.values($nervousSystemLookup).filter((ns) => !ns.isNns).map((ns) => ns.ledgerCanisterId));
$: moreAvailable = moreTransactionsAvailable(transationData);
$: loading = transationData.kind === "loading" || transationData.kind === "loading_more";
Expand Down Expand Up @@ -146,7 +147,7 @@
<div>{$_("cryptoAccount.transactions")}</div>
<div>
<CryptoSelector
filter={(t) => !["ckbtc", "icp"].includes(t.symbol.toLowerCase())}
filter={(t) => snsLedgers.has(t.ledger)}
on:select={ledgerSelected}
{ledger} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/components/home/profile/Accounts.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
$: cryptoBalance = client.cryptoBalance;
$: accounts = buildAccountsList($cryptoLookup, $cryptoBalance);
$: nervousSystemLookup = client.nervousSystemLookup;
$: snsLedgers = new Set<string>(Object.values($nervousSystemLookup).map((ns) => ns.ledgerCanisterId));
$: snsLedgers = new Set<string>(Object.values($nervousSystemLookup).filter((ns) => !ns.isNns).map((ns) => ns.ledgerCanisterId));
$: {
zeroCount = accounts.filter((a) => a.zero).length;
Expand Down
2 changes: 1 addition & 1 deletion frontend/openchat-client/src/openchat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
24 changes: 16 additions & 8 deletions frontend/openchat-client/src/stores/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand All @@ -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) => {
Expand Down Expand Up @@ -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);
}
6 changes: 3 additions & 3 deletions scripts/proposals/upgrade_asset_canister.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d457c2

Please sign in to comment.