only allow settings (to add server) on first run

This commit is contained in:
austinried
2021-08-22 18:28:11 +09:00
parent 8906968186
commit ba22cc7604
4 changed files with 45 additions and 35 deletions

View File

@@ -30,6 +30,8 @@ export type SettingsSlice = {
export const selectSettings = {
client: (state: SettingsSlice) => state.client,
firstRun: (state: SettingsSlice) => state.settings.servers.length === 0,
activeServer: (state: SettingsSlice) => state.settings.servers.find(s => s.id === state.settings.activeServer),
setActiveServer: (state: SettingsSlice) => state.setActiveServer,