mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-01 04:43:33 -06:00
[chore] Settings refactor fix 2 (#1357)
* fix emoji query tagging * fix proxy url for gts instance * fix: don't flash callback error on authorize flow
This commit is contained in:
parent
13e3aaaed1
commit
747683ba54
11 changed files with 37 additions and 31 deletions
|
|
@ -32,6 +32,7 @@ const {
|
|||
} = require("redux-persist");
|
||||
|
||||
const query = require("../lib/query/base");
|
||||
const { Promise } = require("bluebird");
|
||||
|
||||
const combinedReducers = combineReducers({
|
||||
oauth: require("./oauth").reducer,
|
||||
|
|
@ -43,6 +44,14 @@ const persistedReducer = persistReducer({
|
|||
storage: require("redux-persist/lib/storage").default,
|
||||
stateReconciler: require("redux-persist/lib/stateReconciler/autoMergeLevel1").default,
|
||||
whitelist: ["oauth"],
|
||||
migrate: (state) => {
|
||||
return Promise.try(() => {
|
||||
if (state?.oauth != undefined) {
|
||||
state.oauth.expectingRedirect = false;
|
||||
}
|
||||
return state;
|
||||
});
|
||||
}
|
||||
}, combinedReducers);
|
||||
|
||||
const store = configureStore({
|
||||
|
|
|
|||
|
|
@ -23,17 +23,12 @@ const { createSlice } = require("@reduxjs/toolkit");
|
|||
module.exports = createSlice({
|
||||
name: "oauth",
|
||||
initialState: {
|
||||
loginState: 'none'
|
||||
loginState: 'none',
|
||||
expectingRedirect: false
|
||||
},
|
||||
reducers: {
|
||||
setInstance: (state, { payload }) => {
|
||||
return {
|
||||
...state,
|
||||
...payload /* overrides instance, registration keys */
|
||||
};
|
||||
},
|
||||
authorize: (state) => {
|
||||
state.loginState = "callback";
|
||||
authorize: (state, { payload }) => {
|
||||
return payload; // overrides state
|
||||
},
|
||||
setToken: (state, { payload }) => {
|
||||
state.token = `${payload.token_type} ${payload.access_token}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue