mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-30 19:42:17 +00:00
DEV: Remove deprecated integer duration in toasts (#1453)
This update replaces deprecated integer duration with standardized duration of either `short` or `long` throughout the plugin usages of `FloatKit` toasts.
This commit is contained in:
parent
a4194d3fb2
commit
238538c405
@ -87,7 +87,7 @@ export default class AiComposerHelperMenu extends Component {
|
|||||||
const owner = getOwner(this);
|
const owner = getOwner(this);
|
||||||
const options = {
|
const options = {
|
||||||
close: () => this.args.close(),
|
close: () => this.args.close(),
|
||||||
duration: 3000,
|
duration: "short",
|
||||||
data: {
|
data: {
|
||||||
theme: "error",
|
theme: "error",
|
||||||
icon: "triangle-exclamation",
|
icon: "triangle-exclamation",
|
||||||
|
@ -223,7 +223,7 @@ export default class AiEmbeddingEditor extends Component {
|
|||||||
|
|
||||||
this.toasts.success({
|
this.toasts.success({
|
||||||
data: { message: i18n("discourse_ai.embeddings.saved") },
|
data: { message: i18n("discourse_ai.embeddings.saved") },
|
||||||
duration: 2000,
|
duration: "short",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -209,7 +209,7 @@ export default class AiLlmEditorForm extends Component {
|
|||||||
}
|
}
|
||||||
this.toasts.success({
|
this.toasts.success({
|
||||||
data: { message: i18n("discourse_ai.llms.saved") },
|
data: { message: i18n("discourse_ai.llms.saved") },
|
||||||
duration: 2000,
|
duration: "short",
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
popupAjaxError(e);
|
popupAjaxError(e);
|
||||||
|
@ -129,7 +129,7 @@ export default class PersonaEditor extends Component {
|
|||||||
}
|
}
|
||||||
this.toasts.success({
|
this.toasts.success({
|
||||||
data: { message: i18n("discourse_ai.ai_persona.saved") },
|
data: { message: i18n("discourse_ai.ai_persona.saved") },
|
||||||
duration: 2000,
|
duration: "short",
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
popupAjaxError(e);
|
popupAjaxError(e);
|
||||||
|
@ -73,7 +73,7 @@ export default class AiSpam extends Component {
|
|||||||
if (response.success) {
|
if (response.success) {
|
||||||
this.toasts.success({
|
this.toasts.success({
|
||||||
data: { message: i18n("discourse_ai.spam.errors.resolved") },
|
data: { message: i18n("discourse_ai.spam.errors.resolved") },
|
||||||
duration: 2000,
|
duration: "short",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -145,7 +145,7 @@ export default class AiSpam extends Component {
|
|||||||
});
|
});
|
||||||
this.toasts.success({
|
this.toasts.success({
|
||||||
data: { message: i18n("discourse_ai.spam.settings_saved") },
|
data: { message: i18n("discourse_ai.spam.settings_saved") },
|
||||||
duration: 2000,
|
duration: "short",
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
popupAjaxError(error);
|
popupAjaxError(error);
|
||||||
|
@ -84,7 +84,7 @@ export default class AiToolEditorForm extends Component {
|
|||||||
|
|
||||||
this.toasts.success({
|
this.toasts.success({
|
||||||
data: { message: i18n("discourse_ai.tools.saved") },
|
data: { message: i18n("discourse_ai.tools.saved") },
|
||||||
duration: 2000,
|
duration: "short",
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this.args.tools.any((tool) => tool.id === this.args.model.id)) {
|
if (!this.args.tools.any((tool) => tool.id === this.args.model.id)) {
|
||||||
|
@ -82,7 +82,7 @@ export default class ShareModal extends Component {
|
|||||||
async share() {
|
async share() {
|
||||||
await clipboardCopyAsync(this.generateShareURL.bind(this));
|
await clipboardCopyAsync(this.generateShareURL.bind(this));
|
||||||
this.toasts.success({
|
this.toasts.success({
|
||||||
duration: 3000,
|
duration: "short",
|
||||||
data: {
|
data: {
|
||||||
message: i18n("discourse_ai.ai_bot.conversation_shared"),
|
message: i18n("discourse_ai.ai_bot.conversation_shared"),
|
||||||
},
|
},
|
||||||
@ -109,7 +109,7 @@ export default class ShareModal extends Component {
|
|||||||
await clipboardCopyAsync(() => promise);
|
await clipboardCopyAsync(() => promise);
|
||||||
|
|
||||||
this.toasts.success({
|
this.toasts.success({
|
||||||
duration: 3000,
|
duration: "short",
|
||||||
data: {
|
data: {
|
||||||
message: i18n("discourse_ai.ai_bot.embed_copied"),
|
message: i18n("discourse_ai.ai_bot.embed_copied"),
|
||||||
},
|
},
|
||||||
|
@ -140,7 +140,7 @@ export default class AiTagSuggester extends Component {
|
|||||||
if (tags?.length >= maxTags) {
|
if (tags?.length >= maxTags) {
|
||||||
return this.toasts.error({
|
return this.toasts.error({
|
||||||
class: "ai-suggestion-error",
|
class: "ai-suggestion-error",
|
||||||
duration: 3000,
|
duration: "short",
|
||||||
data: {
|
data: {
|
||||||
message: i18n("discourse_ai.ai_helper.suggest_errors.too_many_tags", {
|
message: i18n("discourse_ai.ai_helper.suggest_errors.too_many_tags", {
|
||||||
count: maxTags,
|
count: maxTags,
|
||||||
|
@ -35,7 +35,7 @@ function initializeAiHelperTrigger(api) {
|
|||||||
|
|
||||||
return toasts.error({
|
return toasts.error({
|
||||||
class: "ai-proofread-error-toast",
|
class: "ai-proofread-error-toast",
|
||||||
duration: 3000,
|
duration: "short",
|
||||||
data: {
|
data: {
|
||||||
message: i18n("discourse_ai.ai_helper.no_content_error"),
|
message: i18n("discourse_ai.ai_helper.no_content_error"),
|
||||||
},
|
},
|
||||||
|
@ -116,7 +116,7 @@ export default apiInitializer("1.25.0", (api) => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
toasts.error({
|
toasts.error({
|
||||||
class: "ai-image-caption-error-toast",
|
class: "ai-image-caption-error-toast",
|
||||||
duration: 3000,
|
duration: "short",
|
||||||
data: {
|
data: {
|
||||||
message: extractError(error),
|
message: extractError(error),
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user