33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
// Module ID: 9709
|
|
// Function ID: 9710
|
|
// Name: markChannelUnread
|
|
// Dependencies: [4851, 9710, 504, 2]
|
|
// Exports: default, useCanMarkChannelUnread
|
|
|
|
// Module 9709 (markChannelUnread)
|
|
import ReadStateStore2 from "ReadStateStore" /* 4851 */;
|
|
import markUnreadDefault from "markUnread" /* 9710 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const require = globalThis.__r;
|
|
const ReadStateStore = ReadStateStore2;
|
|
let _require;
|
|
|
|
const ReadState = ReadStateStore2.ReadState;
|
|
const result = size.fileFinishedImporting("modules/channel/markChannelUnread.tsx");
|
|
|
|
export default function markChannelUnread(arg0) {
|
|
const lastMessageId = ReadState.get(arg0).lastMessageId;
|
|
if (null != lastMessageId) {
|
|
markUnreadDefault(arg0, lastMessageId);
|
|
}
|
|
};
|
|
export const useCanMarkChannelUnread = function useCanMarkChannelUnread(channel) {
|
|
_require = channel;
|
|
const items = [ReadStateStore];
|
|
const obj = require("get initialized");
|
|
return obj.useStateFromStores(items, () => {
|
|
const tmp = ReadStateStore.canBeUnread(channel.id) && ReadStateStore.hasLastMessage(channel.id) && !channel.isCategory();
|
|
return tmp;
|
|
});
|
|
};
|