perf: ♻️ Search interaction

This commit is contained in:
viarotel 2024-05-15 11:56:56 +08:00
parent 091d5035dd
commit a195b7ead7
2 changed files with 7 additions and 1 deletions

View File

@ -16,9 +16,12 @@ export default () => {
} }
function close() { function close() {
remote.getCurrentWebContents().stopFindInPage('clearSelection')
if (!findInPage) { if (!findInPage) {
return false return false
} }
return findInPage.closeFindWindow() return findInPage.closeFindWindow()
} }
@ -62,6 +65,8 @@ export default () => {
: {}), : {}),
}) })
console.log('findInPage', findInPage)
return findInPage return findInPage
} }

View File

@ -15,7 +15,7 @@
</template> </template>
<script setup> <script setup>
import { useThemeStore } from '$/store' import { useThemeStore } from '$/store/theme/index.js'
const themeStore = useThemeStore() const themeStore = useThemeStore()
@ -32,6 +32,7 @@ window.electron.ipcRenderer.on('focus-on-search', (event, ret) => {
function openPageModal() { function openPageModal() {
window.findInPageModal.open({ isDark: themeStore.isDark }) window.findInPageModal.open({ isDark: themeStore.isDark })
} }
function closePageModal() { function closePageModal() {
window.findInPageModal.close() window.findInPageModal.close()
} }