more misc minor code cleanup

pull/95/head
dperolio 2 years ago
parent ca04c5d532
commit 3c5275047a
No known key found for this signature in database
GPG Key ID: 4191689562D51409

@ -5,6 +5,9 @@ import { join } from 'path';
import { Directories, ActionTypes } from '@vizality/constants';
import { Flux, FluxDispatcher } from '@vizality/webpack';
/**
* Failsafe to make sure a settings folder exists.
*/
if (!existsSync(Directories.SETTINGS)) {
mkdirSync(Directories.SETTINGS, { recursive: true });
}

@ -3,7 +3,6 @@ import { toPlural, toTitleCase } from '@vizality/util/string';
export default {
command: 'disable',
description: 'Disables a currently enabled addon, or disable all addons.',
icon: 'RadioEmpty',
options: [
{ name: 'id', required: true },
{ name: 'all', required: true }

@ -3,7 +3,6 @@ import { toPlural, toTitleCase } from '@vizality/util/string';
export default {
command: 'enable',
description: 'Enables a currently disabled addon, or enable all addons.',
icon: 'RadioSelected',
options: [
{ name: 'id', required: true },
{ name: 'all', required: true }

@ -26,8 +26,6 @@ export function registerCommands (type) {
vizality.api.commands.registerCommand({
command: type,
description: `Commands related to ${type}s.`,
// Not using Theme.svg icon here because it gets cut off
icon: type === 'plugin' ? 'Plugin' : 'Palette',
options: [
{ name: 'settings', required: true },
{ name: 'manage', required: true },

@ -3,7 +3,6 @@ import { toPlural } from '@vizality/util/string';
export default {
command: 'install',
description: 'Installs an addon.',
icon: 'CloudDownload',
options: [
{ name: 'url', required: true },
{ name: 'id', required: true }

@ -8,7 +8,6 @@ import { open as openModal } from '@vizality/modal';
export default {
command: 'list',
description: 'Displays a list of currently installed addons.',
icon: 'MoreInfo',
options: [
{ name: 'all', required: true },
{ name: 'enabled', required: true },

@ -7,7 +7,6 @@ import { FormTitle } from '@vizality/components';
export default {
command: 'manage',
description: 'Allows you to manage your addons directly in chat.',
icon: 'Wrench',
executor (_, type) {
const result = {
type: 'rich',

@ -3,7 +3,6 @@ import { toPlural, toTitleCase } from '@vizality/util/string';
export default {
command: 'reload',
description: 'Reloads a currently enabled addon, or reload all addons.',
icon: 'Retry',
options: [
{ name: 'id', required: true },
{ name: 'all', required: true }

@ -6,7 +6,6 @@ import { FormTitle, Anchor } from '@vizality/components';
export default {
command: 'settings',
description: `Allows you to change an addon's settings directly in chat.`,
icon: 'Settings',
options: [
{ name: 'id', required: true }
],

@ -3,7 +3,6 @@ import { toPlural } from '@vizality/util/string';
export default {
command: 'stop',
description: 'Temporarily disables all addons. Reload Discord to restore.',
icon: 'NotAllowed',
async executor (_, type) {
try {
await vizality.manager[toPlural(type)].stop();

@ -3,7 +3,6 @@ import { toPlural, toTitleCase } from '@vizality/util/string';
export default {
command: 'uninstall',
description: 'Uninstalls an addon.',
icon: 'Trash',
options: [
{ name: 'id', required: true }
],

@ -29,7 +29,7 @@ export default builtin => {
}
/**
*
*
*/
if (props.href?.startsWith('#')) {
props.onClick = evt => {
@ -62,7 +62,7 @@ export default builtin => {
}
/**
* Force Vizality route links open within the app.
* Force Vizality route links to open within the app.
*/
if (vizalityRegex.test(props.href)) {
const route = props.href?.replace(discordRegex, '');
@ -77,7 +77,7 @@ export default builtin => {
}
/**
* Force Vizality protocol links open within the app.
* Force Vizality protocol links to open within the app.
*/
if (vizalityProtocolRegex.test(props.href)) {
const route = props.href?.replace(vizalityProtocolRegex, '');
@ -92,7 +92,7 @@ export default builtin => {
}
/*
* Force user links open in user profile modals within the app.
* Force user links to open in user profile modals within the app.
*/
if (userRegex.test(props.href)) {
const userId = props.href?.replace(userRegex, '');

@ -30,7 +30,6 @@ export * as Avatar from './components/Avatar';
export * as Role from './components/Role';
// --- Popouts
export * as UserModal from './components/modals/User';
export * as ImageCarouselModal from './components/modals/ImageCarousel';
// --- Popouts
export * as UserPopouts from './components/popouts/User';

@ -1,4 +1,4 @@
import { log, warn, error, MODULES } from '@vizality/util/logger';
import { log, warn, error, PRESET_LABELS } from '@vizality/util/logger';
import { toPlural, toTitleCase } from '@vizality/util/string';
import { resolveCompiler } from '@vizality/compilers';
import { unpatchAll } from '@vizality/patcher';
@ -255,7 +255,7 @@ export default class Plugin extends Updatable {
/**
* Set up a shorthand for the watcher labels used below.
*/
const watcherLabels = this._labels.concat({ text: 'Watcher', color: MODULES.watcher.toString() });
const watcherLabels = this._labels.concat({ text: 'Watcher', color: PRESET_LABELS.watcher.toString() });
/**
*

Loading…
Cancel
Save