feat: chat layout setting
This commit is contained in:
@@ -170,6 +170,13 @@ export const serverApi = createApi({
|
||||
}),
|
||||
getSystemCommon: builder.query<SystemCommon, void>({
|
||||
query: () => ({ url: `/admin/system/common` }),
|
||||
transformResponse: (resp: SystemCommon) => {
|
||||
let tmp = resp;
|
||||
tmp.chat_layout_mode = resp.chat_layout_mode ?? "Left";
|
||||
tmp.contact_verification_enable = resp.contact_verification_enable ?? false;
|
||||
tmp.max_file_expiry_mode = resp.max_file_expiry_mode ?? "Off";
|
||||
return tmp;
|
||||
},
|
||||
async onQueryStarted(data, { dispatch, queryFulfilled }) {
|
||||
try {
|
||||
const resp = await queryFulfilled;
|
||||
|
||||
@@ -22,6 +22,8 @@ const initialState: StoredServer = {
|
||||
},
|
||||
show_user_online_status: false,
|
||||
webclient_auto_update: true,
|
||||
contact_verification_enable: false,
|
||||
chat_layout_mode: "Left"
|
||||
};
|
||||
|
||||
const serverSlice = createSlice({
|
||||
@@ -44,8 +46,10 @@ const serverSlice = createSlice({
|
||||
description = "",
|
||||
show_user_online_status = true,
|
||||
webclient_auto_update = true,
|
||||
contact_verification_enable = false,
|
||||
chat_layout_mode = "Left"
|
||||
} = action.payload || {};
|
||||
return { version, upgraded, name, logo, description, inviteLink, show_user_online_status, webclient_auto_update };
|
||||
return { version, upgraded, name, logo, description, inviteLink, show_user_online_status, webclient_auto_update, contact_verification_enable, chat_layout_mode };
|
||||
},
|
||||
updateInfo(state, action: PayloadAction<Partial<StoredServer>>) {
|
||||
const values = action.payload || {};
|
||||
|
||||
Reference in New Issue
Block a user