Skip to content

Commit

Permalink
chore: upgrade ic_message_frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Dec 17, 2024
1 parent e84b7d8 commit d87c20c
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 13 deletions.
4 changes: 1 addition & 3 deletions canister_ids.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@
"ic": "5szpn-tiaaa-aaaaj-qncoq-cai",
"local": "5szpn-tiaaa-aaaaj-qncoq-cai"
},
"ic_panda_ai": {
"ic": "bwwuq-byaaa-aaaan-qmk4q-cai"
},
"ic_panda_ai": {},
"ic_panda_frontend": {
"ic": "c63a7-6yaaa-aaaap-ab3gq-cai",
"local": "c63a7-6yaaa-aaaap-ab3gq-cai"
Expand Down
25 changes: 25 additions & 0 deletions proposals/proposal-281.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# Load the environment variables
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=49:nat; evidence=blob "\3c\ff\dd\7c\42\8c\af\8e\6a\c7\64\d9\e2\da\62\b6\6b\f6\7f\b2\dd\60\1e\0e\17\f6\f6\ec\11\e0\4b\de"})')"

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.7\";
url = \"https://dMsg.net/\";
summary = \"This proposal executes commit_proposed_batch() on 2fvu6-tqaaa-aaaap-akksa-cai to release ic_message_frontend v2.9.7.\n\n1. chore: improve dMsg app.\";
action = opt variant {
ExecuteGenericNervousSystemFunction = record {
function_id = 1100 : nat64;
payload = ${BLOB};
}
};
}
)" > proposal-message.json

# quill send proposal-message.json
2 changes: 1 addition & 1 deletion src/ic_message_frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@
"test": "vitest run"
},
"type": "module",
"version": "2.9.6"
"version": "2.9.7"
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ type AssetCanisterArgs = variant {
Upgrade: UpgradeArgs;
};

type InitArgs = record {};
type InitArgs = record {
set_permissions: opt SetPermissions;
};

type UpgradeArgs = record {
set_permissions: opt SetPermissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface HttpResponse {
'streaming_strategy' : [] | [StreamingStrategy],
'status_code' : number,
}
export type InitArgs = {};
export interface InitArgs { 'set_permissions' : [] | [SetPermissions] }
export type Key = string;
export interface ListPermitted { 'permission' : Permission }
export type Permission = { 'Prepare' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const idlFactory = ({ IDL }) => {
const UpgradeArgs = IDL.Record({
'set_permissions' : IDL.Opt(SetPermissions),
});
const InitArgs = IDL.Record({});
const InitArgs = IDL.Record({ 'set_permissions' : IDL.Opt(SetPermissions) });
const AssetCanisterArgs = IDL.Variant({
'Upgrade' : UpgradeArgs,
'Init' : InitArgs,
Expand Down Expand Up @@ -287,7 +287,7 @@ export const init = ({ IDL }) => {
const UpgradeArgs = IDL.Record({
'set_permissions' : IDL.Opt(SetPermissions),
});
const InitArgs = IDL.Record({});
const InitArgs = IDL.Record({ 'set_permissions' : IDL.Opt(SetPermissions) });
const AssetCanisterArgs = IDL.Variant({
'Upgrade' : UpgradeArgs,
'Init' : InitArgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import { ErrorLogs, toastRun } from '$lib/stores/toast'
import { errMessage, unwrapOption } from '$lib/types/result'
import { shortId } from '$lib/utils/auth'
import { sleep } from '$lib/utils/helper'
import { getCurrentTimeString, sleep } from '$lib/utils/helper'
import { md } from '$lib/utils/markdown'
import { isNotificationSupported } from '$lib/utils/window'
import LinkItem from '$src/lib/components/ui/LinkItem.svelte'
Expand Down Expand Up @@ -57,7 +57,7 @@
type DisplayUserInfoEx = DisplayUserInfo & {
role: number
sign_in_at: number
sign_in_at: bigint
}
// local: gnhwq-7p3rq-chahe-22f7s-btty6-ntken-g6dff-xwbyd-4qfse-37euh-5ae
Expand Down Expand Up @@ -123,7 +123,7 @@
) as DisplayUserInfoEx
if (info) {
info.role = user.role
info.sign_in_at = Number(user.sign_in_at)
info.sign_in_at = user.sign_in_at
res.push(info)
} else {
res.push({
Expand All @@ -132,7 +132,7 @@
name: 'Unknown',
image: '',
role: user.role,
sign_in_at: Number(user.sign_in_at)
sign_in_at: user.sign_in_at
})
}
}
Expand Down Expand Up @@ -639,6 +639,13 @@
><IconUserForbidLine /></span
>
{/if}
{#if member.sign_in_at > 0}
<span class="text-neutral-500"
>(Sign in at {getCurrentTimeString(
member.sign_in_at
)})</span
>
{/if}
</div>
<div class="flex flex-row items-center space-x-2">
{#if isManager && member.role != 1}
Expand Down
2 changes: 1 addition & 1 deletion src/ic_message_frontend/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const src = globalThis.location?.href || ''

export const APP_VERSION = '2.9.6'
export const APP_VERSION = '2.9.7'
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
Expand Down
1 change: 1 addition & 0 deletions src/ic_message_frontend/src/lib/stores/exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface TokenPrice {

const priceCache: Record<string, TokenPrice> = {}

// Or get from: https://uvevg-iyaaa-aaaak-ac27q-cai.raw.ic0.app/tickers
export function getTokenPrice(
token: string,
syncing: boolean = false
Expand Down

0 comments on commit d87c20c

Please sign in to comment.