Skip to content

Commit

Permalink
chore: merge dev to main
Browse files Browse the repository at this point in the history
  • Loading branch information
Palm authored Feb 25, 2024
2 parents 9225773 + e65a7e3 commit b6c3cd0
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 9 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
name: Build
on:
push:
branches: [main]
branches: [main, dev]
paths-ignore:
- "**/*.md"
- ".github/**"

jobs:
build:
name: Build and push
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
- name: Checkout builds
uses: actions/checkout@v4
with:
repository: "revenge-mod/builds"
path: "builds"
token: ${{ secrets.BUILDS_PUSH_TOKEN }}
ref: ${{ github.ref_name }}

- uses: oven-sh/setup-bun@v1

Expand All @@ -40,5 +46,5 @@ jobs:
- name: Purge CDN cache
if: ${{ false }}
run: |
curl https://purge.jsdelivr.net/gh/vendetta-mod/builds
curl https://purge.jsdelivr.net/gh/revenge-mod/builds
7 changes: 6 additions & 1 deletion src/lib/storage/backends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export const createMMKVBackend = (store: string) => {
})());
}

export const removeMMKVBackend = (store: string) => {
const mmkvPath = getMMKVPath(store);
return FileManager.removeFile('documents', filePathFixer(mmkvPath))
}

export const createFileBackend = (file: string, migratePromise?: Promise<void>): StorageBackend => {
let created: boolean;
return {
Expand All @@ -74,4 +79,4 @@ export const createFileBackend = (file: string, migratePromise?: Promise<void>):
await FileManager.writeFile("documents", filePathFixer(file), JSON.stringify(data), "utf8");
}
};
};
};
2 changes: 1 addition & 1 deletion src/ui/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RedesignObj } from "@/def";
import { RedesignObj } from "@types";
import { ReactNative as RN } from "@metro/common";
import { findByDisplayName, findByName, findByProps } from "@metro/filters";

Expand Down
2 changes: 1 addition & 1 deletion src/ui/settings/components/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ESCAPE_REGEX } from "@/lib/constants";
import { ESCAPE_REGEX } from "@lib/constants";
import { ReactNative as RN, stylesheet } from "@metro/common";
import { findByProps, findByStoreName } from "@metro/filters";
import { getAssetIDByName } from "@ui/assets";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/settings/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import General from "@ui/settings/pages/General";
import Plugins from "@ui/settings/pages/Plugins";
import Themes from "@ui/settings/pages/Themes";
import Developer from "@ui/settings/pages/Developer";
import { PROXY_PREFIXES } from "@/lib/constants";
import { PROXY_PREFIXES } from "@lib/constants";

interface Screen {
[index: string]: any;
Expand Down
37 changes: 36 additions & 1 deletion src/ui/settings/pages/General.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { ReactNative as RN, url } from "@metro/common";
import { DISCORD_SERVER, GITHUB } from "@lib/constants";
import { getDebugInfo, toggleSafeMode } from "@lib/debug";
import { useProxy } from "@lib/storage";
import { removeMMKVBackend, useProxy } from "@lib/storage";
import { BundleUpdaterManager } from "@lib/native";
import { getAssetIDByName } from "@ui/assets";
import { Forms, Summary, ErrorBoundary } from "@ui/components";
import settings from "@lib/settings";
import Version from "@ui/settings/components/Version";
import { showConfirmationAlert } from '@ui/alerts'
import { ButtonColors } from '@types'

const { FormRow, FormSwitchRow, FormSection, FormDivider } = Forms;
const debugInfo = getDebugInfo();
Expand Down Expand Up @@ -140,6 +142,39 @@ export default function General() {
))}
</Summary>
</FormSection>
<FormSection title="Advanced">
<FormRow
label="Clear plugin storage"
leading={<FormRow.Icon source={getAssetIDByName("ic_message_delete")} />}
onPress={() => showConfirmationAlert({
title: "Clear plugin storage?",
content: "All installed plugins will be removed and the app will be reloaded. Plugin settings will still be retained. This is only neccessary if you have a corrupted storage.",
confirmText: "Yes, I have a corrupted storage",
cancelText: "Cancel",
confirmColor: ButtonColors.RED,
onConfirm: () => {
removeMMKVBackend('VENDETTA_PLUGINS')
BundleUpdaterManager.reload()
},
})}
/>
<FormDivider />
<FormRow
label="Clear theme storage"
leading={<FormRow.Icon source={getAssetIDByName("ic_message_delete")} />}
onPress={() => showConfirmationAlert({
title: "Clear theme storage?",
content: "All installed themes will be removed and the app will be reloaded. This is only neccessary if you have a corrupted storage.",
confirmText: "Yes, I have a corrupted storage",
cancelText: "Cancel",
confirmColor: ButtonColors.RED,
onConfirm: () => {
removeMMKVBackend('VENDETTA_THEMES')
BundleUpdaterManager.reload()
},
})}
/>
</FormSection>
</RN.ScrollView>
</ErrorBoundary>
)
Expand Down

0 comments on commit b6c3cd0

Please sign in to comment.