decord/source/stores/UserSettingsAccountStore.tsx

114 lines
3.9 KiB
TypeScript
Raw Normal View History

// Module ID: 7435
// Function ID: 7436
// Name: UserSettingsAccountStore
// Dependencies: [1371, 1074, 504, 573, 2]
2026-07-23 10:11:24 +00:00
// Module 7435 (UserSettingsAccountStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import UserStore from "UserStore" /* 1371 */;
2026-07-20 16:05:17 +00:00
function handleFormClose() {
OPEN = FormStates.CLOSED;
2026-08-24 06:08:38 +00:00
closure_3 = {};
2026-07-20 16:05:17 +00:00
}
const FormStates = fn(1074).FormStates;
let OPEN = FormStates.CLOSED;
2026-07-29 08:29:29 +00:00
let closure_3 = {};
let obj = null;
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class UserSettingsAccountStore extends Store {
}
const prototype = UserSettingsAccountStore.prototype;
prototype["initialize"] = function initialize() {
this.waitFor(UserStore);
2026-07-29 08:29:29 +00:00
};
prototype["getErrors"] = function getErrors() {
return closure_3;
};
prototype["getSubmitting"] = function getSubmitting() {
return OPEN === FormStates.SUBMITTING;
2026-07-29 08:29:29 +00:00
};
prototype["getSettings"] = function getSettings() {
return obj;
2026-07-29 08:29:29 +00:00
};
UserSettingsAccountStore.displayName = "UserSettingsAccountStore";
obj = {
2026-07-29 08:29:29 +00:00
USER_SETTINGS_MODAL_OPEN: function handleFormOpen() {
const currentUser = UserStore.getCurrentUser();
2026-07-29 08:29:29 +00:00
if (null == currentUser) {
OPEN = FormStates.CLOSED;
2026-08-24 06:08:38 +00:00
closure_3 = {};
2026-07-29 08:29:29 +00:00
} else {
OPEN = FormStates.OPEN;
closure_3 = {};
const user = { userId: null, username: null, discriminator: null, email: null, avatar: null, password: "", newPassword: null, claimed: null };
({ id: obj2.userId, username: obj2.username, discriminator: obj2.discriminator, email: obj2.email, avatar: obj2.avatar } = currentUser);
user.claimed = currentUser.isClaimed();
2026-07-29 08:29:29 +00:00
obj = {};
const merged = Object.assign(user);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
},
USER_SETTINGS_MODAL_INIT: function handleFormInit() {
const currentUser = UserStore.getCurrentUser();
2026-07-29 08:29:29 +00:00
if (null == currentUser) {
OPEN = FormStates.CLOSED;
2026-08-24 06:08:38 +00:00
closure_3 = {};
2026-07-29 08:29:29 +00:00
} else {
OPEN = FormStates.OPEN;
closure_3 = {};
const user = { userId: null, username: null, discriminator: null, email: null, avatar: null, password: "", newPassword: null, claimed: null };
({ id: obj2.userId, username: obj2.username, discriminator: obj2.discriminator, email: obj2.email, avatar: obj2.avatar } = currentUser);
user.claimed = currentUser.isClaimed();
2026-07-29 08:29:29 +00:00
obj = {};
const merged = Object.assign(user);
2026-07-20 16:05:17 +00:00
}
},
USER_SETTINGS_MODAL_CLOSE: handleFormClose,
LOGOUT: handleFormClose,
USER_SETTINGS_MODAL_SUBMIT: function handleFormSubmit() {
OPEN = FormStates.SUBMITTING;
2026-07-20 16:05:17 +00:00
},
USER_SETTINGS_MODAL_SUBMIT_FAILURE: function handleFormSubmitFailure(errors) {
2026-07-23 10:11:24 +00:00
if (OPEN !== FormStates.SUBMITTING) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-29 08:29:29 +00:00
OPEN = tmp.OPEN;
2026-07-20 16:05:17 +00:00
errors = errors.errors;
2026-07-29 08:29:29 +00:00
if (errors == null) {
2026-07-20 16:05:17 +00:00
errors = {};
}
closure_3 = errors;
2026-07-20 16:05:17 +00:00
}
},
USER_SETTINGS_MODAL_UPDATE_ACCOUNT: function handleUpdateAccount(settings) {
2026-07-23 10:11:24 +00:00
if (null == obj) {
obj = {};
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj = {};
const merged = Object.assign(obj);
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(settings.settings);
},
2026-07-29 08:29:29 +00:00
USER_SETTINGS_MODAL_SUBMIT_COMPLETE: function handleFormSubmitComplete() {
OPEN = FormStates.OPEN;
2026-08-24 06:08:38 +00:00
closure_3 = {};
2026-07-29 08:29:29 +00:00
},
2026-07-20 16:05:17 +00:00
USER_SETTINGS_MODAL_RESET: function handleFormReset() {
const currentUser = UserStore.getCurrentUser();
OPEN = FormStates.OPEN;
2026-08-24 06:08:38 +00:00
closure_3 = {};
2026-07-20 16:05:17 +00:00
if (null != currentUser) {
const user = { userId: null, username: null, discriminator: null, email: null, avatar: null, password: "", newPassword: null, claimed: null };
({ id: obj2.userId, username: obj2.username, discriminator: obj2.discriminator, email: obj2.email, avatar: obj2.avatar } = currentUser);
user.claimed = currentUser.isClaimed();
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(user);
2026-07-20 16:05:17 +00:00
}
}
};
const userSettingsAccountStore = new UserSettingsAccountStore(DispatcherDefault, obj);
const size = fn(2);
const result = size.fileFinishedImporting("stores/UserSettingsAccountStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default userSettingsAccountStore;