decord/source/actions/DefaultRouteActionCreators.tsx

60 lines
1.8 KiB
TypeScript
Raw Normal View History

// Module ID: 12818
// Function ID: 12819
// Name: DefaultRouteActionCreators
// Dependencies: [4213, 1074, 4400, 4413, 573, 2]
2026-07-20 16:05:17 +00:00
// Exports: saveLastNonVoiceRoute, saveLastRoute
// Module 12818 (DefaultRouteActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import matchPathCompat from "matchPathCompat" /* 4400 */;
import RouteUtils from "RouteUtils" /* 4413 */;
import LurkingStore from "LurkingStore" /* 4213 */;
2026-07-23 10:11:24 +00:00
require = fn;
const Routes = fn(1074).Routes;
const size = fn(2);
const result = size.fileFinishedImporting("actions/DefaultRouteActionCreators.tsx");
2026-07-29 08:29:29 +00:00
export const saveLastRoute = function saveLastRoute(pathname) {
const obj2 = { path: null };
const RouteParam = RouteUtils.RouteParam;
obj2.path = Routes.CHANNEL(RouteParam.guildId());
const matchPathResult = matchPathCompat.matchPath(pathname, obj2);
2026-07-20 16:05:17 +00:00
let guildId;
2026-07-29 08:29:29 +00:00
if (matchPathResult != null) {
2026-07-20 16:05:17 +00:00
const params = matchPathResult.params;
2026-07-29 08:29:29 +00:00
if (params != null) {
2026-07-20 16:05:17 +00:00
guildId = params.guildId;
}
}
2026-07-29 08:29:29 +00:00
let tmp4 = null == guildId;
if (!tmp4) {
tmp4 = !LurkingStore.isLurking(guildId);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
const obj4 = { type: "SAVE_LAST_ROUTE", path: pathname };
DispatcherDefault.dispatch(obj4);
2026-07-20 16:05:17 +00:00
}
};
export const saveLastNonVoiceRoute = function saveLastNonVoiceRoute(Routes) {
const obj2 = { path: null };
const RouteParam = RouteUtils.RouteParam;
obj2.path = Routes.CHANNEL(RouteParam.guildId());
const matchPathResult = matchPathCompat.matchPath(Routes, obj2);
2026-07-29 08:29:29 +00:00
let guildId;
if (matchPathResult != null) {
const params = matchPathResult.params;
if (params != null) {
guildId = params.guildId;
}
}
let tmp4 = null == guildId;
if (!tmp4) {
tmp4 = !LurkingStore.isLurking(guildId);
2026-07-29 08:29:29 +00:00
}
if (tmp4) {
const obj4 = { type: "SAVE_LAST_NON_VOICE_ROUTE", path: Routes };
DispatcherDefault.dispatch(obj4);
2026-07-20 16:05:17 +00:00
}
};