mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-30 14:25:19 +01:00
☕ feat: Prevent Screen Sleep During Response Generation (#10597)
* feat: prevent screen sleep during response generation * refactor: screen wake lock functionality during response generation * chore: import order * chore: reorder import statements in WakeLockManager component --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
5ac9ac57cc
commit
040d083088
7 changed files with 262 additions and 0 deletions
|
|
@ -190,6 +190,14 @@ const isSubmittingFamily = atomFamily({
|
|||
],
|
||||
});
|
||||
|
||||
const anySubmittingSelector = selector<boolean>({
|
||||
key: 'anySubmittingSelector',
|
||||
get: ({ get }) => {
|
||||
const keys = get(conversationKeysAtom);
|
||||
return keys.some((key) => get(isSubmittingFamily(key)) === true);
|
||||
},
|
||||
});
|
||||
|
||||
const optionSettingsFamily = atomFamily<TOptionSettings, string | number>({
|
||||
key: 'optionSettingsByIndex',
|
||||
default: {},
|
||||
|
|
@ -399,6 +407,7 @@ export default {
|
|||
showPopoverFamily,
|
||||
latestMessageFamily,
|
||||
messagesSiblingIdxFamily,
|
||||
anySubmittingSelector,
|
||||
allConversationsSelector,
|
||||
conversationByKeySelector,
|
||||
useClearConvoState,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const localStorageAtoms = {
|
|||
LocalStorageKeys.ENABLE_USER_MSG_MARKDOWN,
|
||||
true,
|
||||
),
|
||||
keepScreenAwake: atomWithLocalStorage('keepScreenAwake', true),
|
||||
|
||||
// Chat settings
|
||||
enterToSend: atomWithLocalStorage('enterToSend', true),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue