fix error text

This commit is contained in:
pa
2026-03-13 00:35:31 +09:00
parent fbe290b788
commit 73493cb0aa
4 changed files with 8 additions and 12 deletions
+3 -3
View File
@@ -108,7 +108,7 @@
import { useGeneralSettingsStore } from '@/stores/settings/general'; import { useGeneralSettingsStore } from '@/stores/settings/general';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { escapeTag, extractFileId } from '../shared/utils'; import { extractFileId } from '../shared/utils';
import { useGalleryStore } from '../stores'; import { useGalleryStore } from '../stores';
const galleryStore = useGalleryStore(); const galleryStore = useGalleryStore();
@@ -301,7 +301,7 @@
toast.success(t('message.image.copied_to_clipboard')); toast.success(t('message.image.copied_to_clipboard'));
} catch (error) { } catch (error) {
console.error('Error downloading image:', error); console.error('Error downloading image:', error);
toast.error(escapeTag(`Failed to download image. ${url}`)); toast.error(`Failed to download image. ${url}`);
} finally { } finally {
toast.dismiss(msg); toast.dismiss(msg);
} }
@@ -331,7 +331,7 @@
document.body.removeChild(link); document.body.removeChild(link);
} catch (error) { } catch (error) {
console.error('Error downloading image:', error); console.error('Error downloading image:', error);
toast.error(escapeTag(`Failed to download image. ${url}`)); toast.error(`Failed to download image. ${url}`);
} finally { } finally {
toast.dismiss(msg); toast.dismiss(msg);
} }
+2 -5
View File
@@ -9,7 +9,6 @@ import {
} from '../stores'; } from '../stores';
import { getCurrentUser } from '../coordinators/userCoordinator'; import { getCurrentUser } from '../coordinators/userCoordinator';
import { AppDebug, isApiLogSuppressed, logWebRequest } from './appConfig.js'; import { AppDebug, isApiLogSuppressed, logWebRequest } from './appConfig.js';
import { escapeTag } from '../shared/utils';
import { i18n } from '../plugins/i18n'; import { i18n } from '../plugins/i18n';
import { statusCodes } from '../shared/constants/api.js'; import { statusCodes } from '../shared/constants/api.js';
import { watchState } from './watchState'; import { watchState } from './watchState';
@@ -194,9 +193,7 @@ export function request(endpoint, options) {
text = data.OK; text = data.OK;
} }
if (text) { if (text) {
toast.success( toast.success(options.customMsg ? options.customMsg : text);
options.customMsg ? options.customMsg : escapeTag(text)
);
} }
return data; return data;
} }
@@ -355,7 +352,7 @@ export function $throw(code, error, endpoint) {
) { ) {
message[1] = `${t('api.error.message.error_message')}: "${t('api.error.message.unavailable')}"`; message[1] = `${t('api.error.message.error_message')}: "${t('api.error.message.unavailable')}"`;
} }
const text = message.map((s) => escapeTag(s)).join('\n'); const text = message.join('\n');
if (text.length && !ignoreError) { if (text.length && !ignoreError) {
toast.error(message[0], { toast.error(message[0], {
+2 -2
View File
@@ -23,7 +23,7 @@ import {
handleFriendAdd, handleFriendAdd,
handleFriendDelete handleFriendDelete
} from '../coordinators/friendRelationshipCoordinator'; } from '../coordinators/friendRelationshipCoordinator';
import { escapeTag, parseLocation } from '../shared/utils'; import { parseLocation } from '../shared/utils';
import { AppDebug } from './appConfig'; import { AppDebug } from './appConfig';
import { groupRequest } from '../api'; import { groupRequest } from '../api';
import { request } from './request'; import { request } from './request';
@@ -201,7 +201,7 @@ function handlePipeline(args) {
if (AppDebug.errorNoty) { if (AppDebug.errorNoty) {
toast.dismiss(AppDebug.errorNoty); toast.dismiss(AppDebug.errorNoty);
} }
AppDebug.errorNoty = toast.error(escapeTag(`WebSocket Error: ${err}`)); AppDebug.errorNoty = toast.error(`WebSocket Error: ${err}`);
return; return;
} }
if (typeof content === 'undefined') { if (typeof content === 'undefined') {
+1 -2
View File
@@ -10,7 +10,6 @@ import {
checkCanInvite, checkCanInvite,
createDefaultNotificationRef, createDefaultNotificationRef,
createDefaultNotificationV2Ref, createDefaultNotificationV2Ref,
escapeTag,
executeWithBackoff, executeWithBackoff,
findUserByDisplayName, findUserByDisplayName,
parseLocation, parseLocation,
@@ -1340,7 +1339,7 @@ export const useNotificationStore = defineStore('Notification', () => {
console.log('Notification response', args); console.log('Notification response', args);
if (!args.json) return; if (!args.json) return;
handleNotificationV2Hide(notificationId); handleNotificationV2Hide(notificationId);
toast.success(escapeTag(args.json)); toast.success(args.json);
}) })
.catch(() => { .catch(() => {
handleNotificationV2Hide(notificationId); handleNotificationV2Hide(notificationId);