mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
chore: update user settings
This commit is contained in:
parent
8992d48b3e
commit
908f95772d
@ -84,8 +84,9 @@ func getUserSetting(ctx context.Context, s *store.Store, userID int32) (*apiv2pb
|
||||
}
|
||||
|
||||
userSetting := &apiv2pb.UserSetting{
|
||||
Id: userID,
|
||||
Locale: apiv2pb.UserSetting_LOCALE_EN,
|
||||
Id: userID,
|
||||
Locale: apiv2pb.UserSetting_LOCALE_EN,
|
||||
ColorTheme: apiv2pb.UserSetting_COLOR_THEME_LIGHT,
|
||||
}
|
||||
for _, setting := range userSettings {
|
||||
if setting.Key == storepb.UserSettingKey_USER_SETTING_LOCALE {
|
||||
|
@ -8,7 +8,7 @@ const PreferenceSection: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const userStore = useUserStore();
|
||||
const userSetting = userStore.getCurrentUserSetting();
|
||||
const language = userSetting.locale || UserSetting_Locale.EN;
|
||||
const language = userSetting.locale;
|
||||
const colorTheme = userSetting.colorTheme;
|
||||
|
||||
const languageOptions = [
|
||||
@ -23,10 +23,6 @@ const PreferenceSection: React.FC = () => {
|
||||
];
|
||||
|
||||
const colorThemeOptions = [
|
||||
{
|
||||
value: "COLOR_THEME_UNSPECIFIED",
|
||||
label: "Auto",
|
||||
},
|
||||
{
|
||||
value: "COLOR_THEME_LIGHT",
|
||||
label: "Light",
|
||||
@ -52,6 +48,10 @@ const PreferenceSection: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleSelectColorTheme = async (colorTheme: UserSetting_ColorTheme) => {
|
||||
if (!colorTheme) {
|
||||
return;
|
||||
}
|
||||
|
||||
await userStore.updateUserSetting(
|
||||
{
|
||||
...userSetting,
|
||||
|
@ -74,8 +74,8 @@ const Home: React.FC = () => {
|
||||
loading
|
||||
</div>
|
||||
) : orderedShortcutList.length === 0 ? (
|
||||
<div className="py-16 w-full flex flex-col justify-center items-center">
|
||||
<Icon.PackageOpen className="w-16 h-auto text-gray-400" />
|
||||
<div className="py-16 w-full flex flex-col justify-center items-center text-gray-400">
|
||||
<Icon.PackageOpen className="w-16 h-auto" strokeWidth="1" />
|
||||
<p className="mt-4">No shortcuts found.</p>
|
||||
</div>
|
||||
) : (
|
||||
|
@ -18,10 +18,6 @@ const Setting: React.FC = () => {
|
||||
{isAdmin && (
|
||||
<>
|
||||
<Divider />
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold">Workspace setting</h2>
|
||||
<p className="text-gray-500 text-sm">Manage your workspace.</p>
|
||||
</div>
|
||||
<MemberSection />
|
||||
<WorkspaceSection />
|
||||
</>
|
||||
|
Loading…
x
Reference in New Issue
Block a user