Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from ulu-telegram/master
Browse files Browse the repository at this point in the history
deploy
ulugmer authored Nov 20, 2023
2 parents 60ed4f5 + df925a1 commit 9fd37e2
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 11 additions & 6 deletions src/components/main/CommandMenu.tsx
Original file line number Diff line number Diff line change
@@ -125,6 +125,7 @@ interface HomePageProps {
handleSelectNewChannel: () => void;
handleCreateFolder: () => void;
handleLockScreenHotkey: () => void;
commandToggleArchiver: () => void;
}

interface CreateNewPageProps {
@@ -138,7 +139,7 @@ const HomePage: React.FC<HomePageProps> = ({
handleSearchFocus, handleOpenSavedMessages, handleSelectSettings,
handleSelectArchived, handleOpenInbox, menuItems, saveAPIKey,
handleSupport, handleFAQ, handleChangelog, handleSelectNewGroup, handleCreateFolder, handleSelectNewChannel,
handleOpenShortcuts, handleLockScreenHotkey,
handleOpenShortcuts, handleLockScreenHotkey, commandToggleArchiver,
}) => {
return (
<>
@@ -173,6 +174,9 @@ const HomePage: React.FC<HomePageProps> = ({
<Command.Item onSelect={commandArchiveAll}>
<i className="icon icon-archive" /><span>Mark read chats as &quot;Done&quot; (May take ~1-3 min)</span>
</Command.Item>
<Command.Item onSelect={commandToggleArchiver}>
<i className="icon icon-readchats" /><span>Auto-Done After Reading</span>
</Command.Item>
{menuItems.map((item, index) => (
<Command.Item key={index} onSelect={item.value === 'save_api_key' ? saveAPIKey : undefined}>
{item.label}
@@ -181,7 +185,7 @@ const HomePage: React.FC<HomePageProps> = ({
</Command.Group>
<Command.Group heading="Help">
<Command.Item onSelect={handleFAQ}>
<i className="icon icon-document" /><span>Open FAQ</span>
<i className="icon icon-document" /><span>Help center</span>
</Command.Item>
<Command.Item onSelect={handleOpenShortcuts}>
<i className="icon icon-keyboard" /><span>Keyboard shortcuts</span>
@@ -281,9 +285,9 @@ const CommandMenu: FC<CommandMenuProps> = ({ topUserIds, usersById }) => {
showNotification, openUrl, openChatByUsername,
} = getActions();
const [isOpen, setOpen] = useState(false);
/* const [isArchiverEnabled, setIsArchiverEnabled] = useState(
const [isArchiverEnabled, setIsArchiverEnabled] = useState(
!!JSON.parse(String(localStorage.getItem('ulu_is_autoarchiver_enabled'))),
); */
);
const { archiveMessages } = useArchiver({ isManual: true });
const [inputValue, setInputValue] = useState('');
const [menuItems, setMenuItems] = useState<Array<{ label: string; value: string }>>([]);
@@ -416,13 +420,13 @@ const CommandMenu: FC<CommandMenuProps> = ({ topUserIds, usersById }) => {
close();
}, [runCommand, close]);

/* const commandToggleArchiver = useCallback(() => {
const commandToggleArchiver = useCallback(() => {
const updIsArchiverEnabled = !isArchiverEnabled;
showNotification({ message: updIsArchiverEnabled ? 'Archiver enabled!' : 'Archiver disabled!' });
localStorage.setItem('ulu_is_autoarchiver_enabled', JSON.stringify(updIsArchiverEnabled));
setIsArchiverEnabled(updIsArchiverEnabled);
close();
}, [close, isArchiverEnabled]); */
}, [close, isArchiverEnabled]);

const commandArchiveAll = useCallback(() => {
showNotification({ message: 'All older than 24 hours will be archived!' });
@@ -494,6 +498,7 @@ const CommandMenu: FC<CommandMenuProps> = ({ topUserIds, usersById }) => {
handleSelectNewChannel={handleSelectNewChannel}
handleCreateFolder={handleCreateFolder}
handleLockScreenHotkey={handleLockScreenHotkey}
commandToggleArchiver={commandToggleArchiver}
/>
)}
{activePage === 'createNew' && (
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -299,9 +299,9 @@ export const DEFAULT_LANG_CODE = 'en';
export const DEFAULT_LANG_PACK = 'android';
export const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;
export const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';
export const FAQ_URL = 'https://ulumessenger.notion.site/Getting-Started-with-ulu-046fcebdeb7b41a1b10c0a0b6b07ca75';
export const FAQ_URL = 'https://ulumessenger.notion.site/ulu-messanger-help-center-2d450bbede8044a296b8f1ce707e2539';
// eslint-disable-next-line max-len
export const SHORTCUTS_URL = 'https://ulumessenger.notion.site/Getting-Started-with-ulu-046fcebdeb7b41a1b10c0a0b6b07ca75?pvs=4#3049aec77dc14baaa3c3a186f5bafb52';
export const SHORTCUTS_URL = 'https://ulumessenger.notion.site/ulu-keyboard-shortcuts-73b7cc9a5c3843c3b1f7449e0df72a6c';
export const PRIVACY_URL = 'https://telegram.org/privacy';
export const MINI_APP_TOS_URL = 'https://telegram.org/tos/mini-apps';
export const GENERAL_TOPIC_ID = 1;

0 comments on commit 9fd37e2

Please sign in to comment.