-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "feat: add clear messages confirm modal"
This reverts commit 3588f2d.
- Loading branch information
Showing
8 changed files
with
8 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,26 @@ | ||
import { useStore } from '@nanostores/solid' | ||
import { currentConversationId } from '@/stores/conversation' | ||
import { | ||
scrollController, | ||
showConfirmModal, | ||
} from '@/stores/ui' | ||
import { scrollController } from '@/stores/ui' | ||
import { clearMessagesByConversationId } from '@/stores/messages' | ||
import { useI18n } from '@/hooks' | ||
import ConfirmModal from '../ui/ConfirmModal' | ||
|
||
export default () => { | ||
const $currentConversationId = useStore(currentConversationId) | ||
const { t } = useI18n() | ||
|
||
const handleClearMessage = () => { | ||
clearMessagesByConversationId($currentConversationId()) | ||
scrollController().scrollToBottom() | ||
showConfirmModal.set(false) | ||
} | ||
|
||
return ( | ||
<> | ||
{ $currentConversationId() && ( | ||
<div | ||
class="fcc p-2 rounded-md text-xl hv-foreground" | ||
onClick={() => { showConfirmModal.set(true) }} | ||
onClick={handleClearMessage} | ||
> | ||
<div i-carbon-clean /> | ||
</div> | ||
)} | ||
<ConfirmModal title={t('conversations.confirm.title')} description={t('conversations.confirm.desc')} onConfirm={handleClearMessage} onCancel={() => { showConfirmModal.set(false) }} /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters