mirror of
https://github.com/Equicord/Equicord.git
synced 2025-02-07 08:44:31 -05:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
fe4747302a
1 changed files with 28 additions and 2 deletions
|
@ -16,6 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { Settings } from "@api/Settings";
|
||||||
import BackupAndRestoreTab from "@components/VencordSettings/BackupAndRestoreTab";
|
import BackupAndRestoreTab from "@components/VencordSettings/BackupAndRestoreTab";
|
||||||
import CloudTab from "@components/VencordSettings/CloudTab";
|
import CloudTab from "@components/VencordSettings/CloudTab";
|
||||||
import PatchHelperTab from "@components/VencordSettings/PatchHelperTab";
|
import PatchHelperTab from "@components/VencordSettings/PatchHelperTab";
|
||||||
|
@ -24,7 +25,7 @@ import UpdaterTab from "@components/VencordSettings/UpdaterTab";
|
||||||
import VencordTab from "@components/VencordSettings/VencordTab";
|
import VencordTab from "@components/VencordSettings/VencordTab";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { React } from "@webpack/common";
|
import { i18n, React } from "@webpack/common";
|
||||||
|
|
||||||
import gitHash from "~git-hash";
|
import gitHash from "~git-hash";
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ export default definePlugin({
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "#{intl::ACTIVITY_SETTINGS}",
|
find: ".SEARCH_NO_RESULTS&&0===",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /(?<=section:(.{0,50})\.DIVIDER\}\))([,;])(?=.{0,200}(\i)\.push.{0,100}label:(\i)\.header)/,
|
match: /(?<=section:(.{0,50})\.DIVIDER\}\))([,;])(?=.{0,200}(\i)\.push.{0,100}label:(\i)\.header)/,
|
||||||
|
@ -147,6 +148,31 @@ export default definePlugin({
|
||||||
].filter(Boolean);
|
].filter(Boolean);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isRightSpot({ header, settings }: { header?: string; settings?: string[]; }) {
|
||||||
|
const firstChild = settings?.[0];
|
||||||
|
// lowest two elements... sanity backup
|
||||||
|
if (firstChild === "LOGOUT" || firstChild === "SOCIAL_LINKS") return true;
|
||||||
|
|
||||||
|
const { settingsLocation } = Settings.plugins.Settings;
|
||||||
|
|
||||||
|
if (settingsLocation === "bottom") return firstChild === "LOGOUT";
|
||||||
|
if (settingsLocation === "belowActivity") return firstChild === "CHANGELOG";
|
||||||
|
|
||||||
|
if (!header) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const names = {
|
||||||
|
top: i18n.Messages.USER_SETTINGS,
|
||||||
|
aboveNitro: i18n.Messages.BILLING_SETTINGS,
|
||||||
|
belowNitro: i18n.Messages.APP_SETTINGS,
|
||||||
|
aboveActivity: i18n.Messages.ACTIVITY_SETTINGS
|
||||||
|
};
|
||||||
|
return header === names[settingsLocation];
|
||||||
|
} catch {
|
||||||
|
return firstChild === "PREMIUM";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
patchedSettings: new WeakSet(),
|
patchedSettings: new WeakSet(),
|
||||||
|
|
||||||
addSettings(elements: any[], element: { header?: string; settings: string[]; }, sectionTypes: SectionTypes) {
|
addSettings(elements: any[], element: { header?: string; settings: string[]; }, sectionTypes: SectionTypes) {
|
||||||
|
|
Loading…
Reference in a new issue