(url = "/", id = nanoid())
| 8 | |
| 9 | export const create = |
| 10 | (url = "/", id = nanoid()): Thunk<string> => |
| 11 | (dispatch) => { |
| 12 | dispatch(SessionQueries.init(id)) |
| 13 | dispatch(Tabs.add(id)) |
| 14 | // move to tabHistories.restore(id, url) |
| 15 | const history = global.tabHistories.get(id) |
| 16 | if (history) { |
| 17 | if (history.location.pathname !== url) history.push(url) |
| 18 | } else { |
| 19 | global.tabHistories.create(id, [{pathname: url}], 0) |
| 20 | } |
| 21 | // end |
| 22 | dispatch(Tabs.activate(id)) |
| 23 | return id |
| 24 | } |
| 25 | |
| 26 | export const createQuerySession = |
| 27 | (): Thunk<string> => |