mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Rename account data field to in.cinny.explore
This commit is contained in:
parent
96746d8976
commit
919be5b846
2 changed files with 4 additions and 4 deletions
|
|
@ -13,7 +13,7 @@ export const useExploreServers = (): [
|
|||
(server: string) => Promise<void>
|
||||
] => {
|
||||
const mx = useMatrixClient();
|
||||
const accountData = useAccountData(AccountDataEvent.CinnyExploreServers);
|
||||
const accountData = useAccountData(AccountDataEvent.CinnyExplore);
|
||||
const userAddedServers = useMemo(
|
||||
() => accountData?.getContent<InCinnyExploreServersContent>()?.servers ?? [],
|
||||
[accountData]
|
||||
|
|
@ -22,7 +22,7 @@ export const useExploreServers = (): [
|
|||
const addServer = useCallback(
|
||||
async (server: string) => {
|
||||
if (userAddedServers.indexOf(server) === -1) {
|
||||
await mx.setAccountData(AccountDataEvent.CinnyExploreServers, {
|
||||
await mx.setAccountData(AccountDataEvent.CinnyExplore, {
|
||||
servers: [...userAddedServers, server],
|
||||
});
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ export const useExploreServers = (): [
|
|||
|
||||
const removeServer = useCallback(
|
||||
async (server: string) => {
|
||||
await mx.setAccountData(AccountDataEvent.CinnyExploreServers, {
|
||||
await mx.setAccountData(AccountDataEvent.CinnyExplore, {
|
||||
servers: userAddedServers.filter((addedServer) => server !== addedServer),
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export enum AccountDataEvent {
|
|||
IgnoredUserList = 'm.ignored_user_list',
|
||||
|
||||
CinnySpaces = 'in.cinny.spaces',
|
||||
CinnyExploreServers = 'in.cinny.explore_servers',
|
||||
CinnyExplore = 'in.cinny.explore',
|
||||
|
||||
ElementRecentEmoji = 'io.element.recent_emoji',
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue