Skip to content

Commit

Permalink
Add local_user_index_canister_id to initial_state response (#5083)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Dec 31, 2023
1 parent e7240f7 commit 09811d3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions backend/canisters/user/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Changed

- Add `local_user_index_canister_id` to `initial_state` response ([#5083](https://github.com/open-chat-labs/open-chat/pull/5083))

### Removed

- Remove group summary cache ([#5067](https://github.com/open-chat-labs/open-chat/pull/5067))
Expand Down
1 change: 1 addition & 0 deletions backend/canisters/user/api/can.did
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ type InitialStateResponse = variant {
avatar_id : opt nat;
blocked_users : vec UserId;
suspended : bool;
local_user_index_canister_id : CanisterId;
};
};

Expand Down
3 changes: 2 additions & 1 deletion backend/canisters/user/api/src/queries/initial_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use candid::CandidType;
use serde::{Deserialize, Serialize};
use types::{Chat, ChatId, DirectChatSummary, Empty, GroupChatSummary, TimestampMillis, UserId};
use types::{CanisterId, Chat, ChatId, DirectChatSummary, Empty, GroupChatSummary, TimestampMillis, UserId};

pub type Args = Empty;

Expand All @@ -19,6 +19,7 @@ pub struct SuccessResult {
pub avatar_id: Option<u128>,
pub blocked_users: Vec<UserId>,
pub suspended: bool,
pub local_user_index_canister_id: CanisterId,
}

#[derive(CandidType, Serialize, Deserialize, Debug)]
Expand Down
1 change: 1 addition & 0 deletions backend/canisters/user/impl/src/queries/initial_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ fn initial_state_impl(state: &RuntimeState) -> Response {
avatar_id,
blocked_users,
suspended: state.data.suspended.value,
local_user_index_canister_id: state.data.local_user_index_canister_id,
})
}

0 comments on commit 09811d3

Please sign in to comment.