2017-08-18 21:30:16 +00:00
|
|
|
import { SERVER } from './actionsTypes';
|
|
|
|
|
2021-01-13 14:16:00 +00:00
|
|
|
export function selectServerRequest(server, version, fetchVersion = true, changeServer = false) {
|
2017-08-18 21:30:16 +00:00
|
|
|
return {
|
2018-08-01 19:35:06 +00:00
|
|
|
type: SERVER.SELECT_REQUEST,
|
2019-04-17 17:01:03 +00:00
|
|
|
server,
|
|
|
|
version,
|
2021-01-13 14:16:00 +00:00
|
|
|
fetchVersion,
|
|
|
|
changeServer
|
2017-08-18 21:30:16 +00:00
|
|
|
};
|
|
|
|
}
|
2018-08-01 19:35:06 +00:00
|
|
|
|
2019-04-17 17:01:03 +00:00
|
|
|
export function selectServerSuccess(server, version) {
|
2018-08-01 19:35:06 +00:00
|
|
|
return {
|
|
|
|
type: SERVER.SELECT_SUCCESS,
|
2019-04-17 17:01:03 +00:00
|
|
|
server,
|
|
|
|
version
|
2018-08-01 19:35:06 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-06-17 13:57:07 +00:00
|
|
|
export function selectServerFailure() {
|
|
|
|
return {
|
|
|
|
type: SERVER.SELECT_FAILURE
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-01-17 21:27:28 +00:00
|
|
|
// TODO
|
|
|
|
export function serverRequest(server, username, fromServerHistory = false) {
|
2017-09-01 19:42:50 +00:00
|
|
|
return {
|
|
|
|
type: SERVER.REQUEST,
|
2019-09-02 16:19:05 +00:00
|
|
|
server,
|
2022-01-17 21:27:28 +00:00
|
|
|
username: username || null,
|
2020-09-11 17:10:16 +00:00
|
|
|
fromServerHistory
|
2017-09-01 19:42:50 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function serverSuccess() {
|
|
|
|
return {
|
|
|
|
type: SERVER.SUCCESS
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function serverFailure(err) {
|
|
|
|
return {
|
|
|
|
type: SERVER.FAILURE,
|
|
|
|
err
|
|
|
|
};
|
|
|
|
}
|
2018-08-31 18:13:30 +00:00
|
|
|
|
2020-06-15 14:00:46 +00:00
|
|
|
export function serverInitAdd(previousServer) {
|
2018-08-31 18:13:30 +00:00
|
|
|
return {
|
2020-06-15 14:00:46 +00:00
|
|
|
type: SERVER.INIT_ADD,
|
|
|
|
previousServer
|
2018-08-31 18:13:30 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function serverFinishAdd() {
|
|
|
|
return {
|
|
|
|
type: SERVER.FINISH_ADD
|
|
|
|
};
|
|
|
|
}
|