Browser based potokens
This commit is contained in:
1 parent
5e798f19de
commit
63f9ac693a
27 files changed
+722
-499
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<script lang="ts">
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { translate } from "lib/Stores";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
|
||||
export let displayText: string = "";
|
||||
// svelte-ignore unused-export-let
|
||||
export let key: string = "";
|
||||
export let description: string = "";
|
||||
export let level: number = 0;
|
||||
|
||||
async function clearPoTokens() {
|
||||
await PlayletApi.clearPoTokens();
|
||||
alert(get(translate)("PoTokens cleared."));
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="m-5">
|
||||
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||
<button class="btn m-1" on:click={clearPoTokens}
|
||||
>{$translate("Clear PoTokens")}</button
|
||||
>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
<script lang="ts">
|
||||
import { translate } from "lib/Stores";
|
||||
import { ensureDevicePoTokenWithToast } from "lib/ensureDevicePoToken";
|
||||
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
|
||||
export let displayText: string = "";
|
||||
// svelte-ignore unused-export-let
|
||||
export let key: string = "";
|
||||
export let description: string = "";
|
||||
export let level: number = 0;
|
||||
</script>
|
||||
|
||||
<div class="m-5">
|
||||
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||
<button class="btn m-1" on:click={() => ensureDevicePoTokenWithToast(true)}
|
||||
>{$translate("Mint PoToken")}</button
|
||||
>
|
||||
</div>
|
||||
@@ -7,6 +7,8 @@
|
||||
import StringControl from "lib/Screens/Settings/SettingControls/StringControl.svelte";
|
||||
import NumberControl from "./SettingControls/NumberControl.svelte";
|
||||
import ClearCacheControl from "./SettingControls/ClearCacheControl.svelte";
|
||||
import ClearPoTokensControl from "./SettingControls/ClearPoTokensControl.svelte";
|
||||
import MintPoTokenControl from "./SettingControls/MintPoTokenControl.svelte";
|
||||
import EditQualityControl from "./SettingControls/EditQualityControl.svelte";
|
||||
import SponsorBlockCategoriesControl from "./SettingControls/SponsorBlockCategoriesControl.svelte";
|
||||
import { translate } from "lib/Stores";
|
||||
@@ -34,6 +36,8 @@
|
||||
const customComponents = {
|
||||
ClearSearchHistoryControl,
|
||||
ClearCacheControl,
|
||||
ClearPoTokensControl,
|
||||
MintPoTokenControl,
|
||||
EditHomeScreenControl,
|
||||
PlayletLibVersionControl,
|
||||
EditQualityControl,
|
||||
|
||||
Reference in new issue
Block a user