mirror of
https://github.com/LBRYFoundation/Watch-on-LBRY.git
synced 2025-08-23 17:47:26 +00:00
🍙 clear cache button added
This commit is contained in:
parent
3a07d7f82b
commit
89ce1aeb31
3 changed files with 19 additions and 1 deletions
|
@ -5,6 +5,10 @@
|
||||||
justify-content: center
|
justify-content: center
|
||||||
flex-wrap: wrap
|
flex-wrap: wrap
|
||||||
gap: .25em
|
gap: .25em
|
||||||
|
cursor: pointer
|
||||||
|
|
||||||
|
*
|
||||||
|
cursor: pointer
|
||||||
|
|
||||||
.radio-button
|
.radio-button
|
||||||
@extend .button
|
@extend .button
|
||||||
|
|
|
@ -11,3 +11,6 @@
|
||||||
display: grid
|
display: grid
|
||||||
grid-auto-flow: row
|
grid-auto-flow: row
|
||||||
gap: 1em
|
gap: 1em
|
||||||
|
|
||||||
|
button
|
||||||
|
cursor: pointer
|
|
@ -1,7 +1,9 @@
|
||||||
import { h, render } from 'preact'
|
import { h, render } from 'preact'
|
||||||
|
import { useState } from 'preact/hooks'
|
||||||
import ButtonRadio, { SelectionOption } from '../common/components/ButtonRadio'
|
import ButtonRadio, { SelectionOption } from '../common/components/ButtonRadio'
|
||||||
import { ExtensionSettings, getTargetPlatfromSettingsEntiries, getYtUrlResolversSettingsEntiries, TargetPlatformName, YTUrlResolverName } from '../common/settings'
|
import { ExtensionSettings, getTargetPlatfromSettingsEntiries, getYtUrlResolversSettingsEntiries, TargetPlatformName, YTUrlResolverName } from '../common/settings'
|
||||||
import { useLbrySettings } from '../common/useSettings'
|
import { useLbrySettings } from '../common/useSettings'
|
||||||
|
import { LbryPathnameCache } from '../common/yt/urlCache'
|
||||||
import './popup.sass'
|
import './popup.sass'
|
||||||
|
|
||||||
/** Utilty to set a setting in the browser */
|
/** Utilty to set a setting in the browser */
|
||||||
|
@ -16,6 +18,7 @@ const ytUrlResolverOptions: SelectionOption[] = getYtUrlResolversSettingsEntirie
|
||||||
|
|
||||||
function WatchOnLbryPopup() {
|
function WatchOnLbryPopup() {
|
||||||
const { redirect, targetPlatform, urlResolver } = useLbrySettings()
|
const { redirect, targetPlatform, urlResolver } = useLbrySettings()
|
||||||
|
let [clearingCache, updateClearingCache] = useState(() => false)
|
||||||
|
|
||||||
return <div className='container'>
|
return <div className='container'>
|
||||||
<section>
|
<section>
|
||||||
|
@ -33,6 +36,14 @@ function WatchOnLbryPopup() {
|
||||||
<ButtonRadio value={urlResolver} options={ytUrlResolverOptions}
|
<ButtonRadio value={urlResolver} options={ytUrlResolverOptions}
|
||||||
onChange={(urlResolver: YTUrlResolverName) => setSetting('urlResolver', urlResolver)} />
|
onChange={(urlResolver: YTUrlResolverName) => setSetting('urlResolver', urlResolver)} />
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<a onClick={async () => {
|
||||||
|
await LbryPathnameCache.clearAll()
|
||||||
|
alert('Cleared Cache.')
|
||||||
|
}}>
|
||||||
|
<button type='button' className='btn1 button is-primary'>{clearingCache ? 'Clearing Cache...' : 'Clear Cache'}</button>
|
||||||
|
</a>
|
||||||
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<label className='radio-label'>Other useful tools:</label>
|
<label className='radio-label'>Other useful tools:</label>
|
||||||
<a href='/tools/YTtoLBRY.html' target='_blank'>
|
<a href='/tools/YTtoLBRY.html' target='_blank'>
|
||||||
|
|
Loading…
Add table
Reference in a new issue