decord/source/modules/notifications/native/InAppMessageSoundsStore.tsx

35 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-08-28 06:19:39 +00:00
// Module ID: 10125
// Function ID: 10126
2026-07-20 16:05:17 +00:00
// Name: isInAppMessageSoundsEnabled
2026-08-28 06:19:39 +00:00
// Dependencies: [595, 700, 4075, 2]
2026-07-20 16:05:17 +00:00
// Exports: isInAppMessageSoundsEnabled, setInAppMessageSoundsEnabled, useInAppMessageSoundsEnabled
2026-08-28 06:19:39 +00:00
// Module 10125 (isInAppMessageSoundsEnabled)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import Storage2 from "Storage" /* 595 */;
2026-08-28 06:19:39 +00:00
import isIterable from "isIterable" /* 4075 */;
2026-08-24 06:08:38 +00:00
import identity from "identity" /* 700 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
const InAppMessageSoundsEnabled = "InAppMessageSoundsEnabled";
let closure_3 = identity.createWithEqualityFn(() => {
2026-08-24 06:08:38 +00:00
const Storage = Storage2.Storage;
2026-07-29 08:29:29 +00:00
let isEnabled = Storage.get(InAppMessageSoundsEnabled);
if (isEnabled == null) {
isEnabled = true;
}
return { isEnabled };
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
let result = set.fileFinishedImporting("modules/notifications/native/InAppMessageSoundsStore.tsx");
2026-07-20 16:05:17 +00:00
export const isInAppMessageSoundsEnabled = function isInAppMessageSoundsEnabled() {
return store.getState().isEnabled;
};
export const setInAppMessageSoundsEnabled = function setInAppMessageSoundsEnabled(isEnabled) {
2026-08-24 06:08:38 +00:00
const Storage = Storage2.Storage;
2026-07-29 08:29:29 +00:00
const result = Storage.set(InAppMessageSoundsEnabled, isEnabled);
2026-07-20 16:05:17 +00:00
store.setState({ isEnabled });
};
export const useInAppMessageSoundsEnabled = function useInAppMessageSoundsEnabled() {
2026-08-24 06:08:38 +00:00
return store((isEnabled) => isEnabled.isEnabled, isIterable.shallow);
2026-07-20 16:05:17 +00:00
};