mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-29 11:02: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 options = {
|
||||
close: () => this.args.close(),
|
||||
duration: 3000,
|
||||
duration: "short",
|
||||
data: {
|
||||
theme: "error",
|
||||
icon: "triangle-exclamation",
|
||||
|
@ -223,7 +223,7 @@ export default class AiEmbeddingEditor extends Component {
|
||||
|
||||
this.toasts.success({
|
||||
data: { message: i18n("discourse_ai.embeddings.saved") },
|
||||
duration: 2000,
|
||||
duration: "short",
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -209,7 +209,7 @@ export default class AiLlmEditorForm extends Component {
|
||||
}
|
||||
this.toasts.success({
|
||||
data: { message: i18n("discourse_ai.llms.saved") },
|
||||
duration: 2000,
|
||||
duration: "short",
|
||||
});
|
||||
} catch (e) {
|
||||
popupAjaxError(e);
|
||||
|
@ -129,7 +129,7 @@ export default class PersonaEditor extends Component {
|
||||
}
|
||||
this.toasts.success({
|
||||
data: { message: i18n("discourse_ai.ai_persona.saved") },
|
||||
duration: 2000,
|
||||
duration: "short",
|
||||
});
|
||||
} catch (e) {
|
||||
popupAjaxError(e);
|
||||
|
@ -73,7 +73,7 @@ export default class AiSpam extends Component {
|
||||
if (response.success) {
|
||||
this.toasts.success({
|
||||
data: { message: i18n("discourse_ai.spam.errors.resolved") },
|
||||
duration: 2000,
|
||||
duration: "short",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
@ -145,7 +145,7 @@ export default class AiSpam extends Component {
|
||||
});
|
||||
this.toasts.success({
|
||||
data: { message: i18n("discourse_ai.spam.settings_saved") },
|
||||
duration: 2000,
|
||||
duration: "short",
|
||||
});
|
||||
} catch (error) {
|
||||
popupAjaxError(error);
|
||||
|
@ -84,7 +84,7 @@ export default class AiToolEditorForm extends Component {
|
||||
|
||||
this.toasts.success({
|
||||
data: { message: i18n("discourse_ai.tools.saved") },
|
||||
duration: 2000,
|
||||
duration: "short",
|
||||
});
|
||||
|
||||
if (!this.args.tools.any((tool) => tool.id === this.args.model.id)) {
|
||||
|
@ -82,7 +82,7 @@ export default class ShareModal extends Component {
|
||||
async share() {
|
||||
await clipboardCopyAsync(this.generateShareURL.bind(this));
|
||||
this.toasts.success({
|
||||
duration: 3000,
|
||||
duration: "short",
|
||||
data: {
|
||||
message: i18n("discourse_ai.ai_bot.conversation_shared"),
|
||||
},
|
||||
@ -109,7 +109,7 @@ export default class ShareModal extends Component {
|
||||
await clipboardCopyAsync(() => promise);
|
||||
|
||||
this.toasts.success({
|
||||
duration: 3000,
|
||||
duration: "short",
|
||||
data: {
|
||||
message: i18n("discourse_ai.ai_bot.embed_copied"),
|
||||
},
|
||||
|
@ -140,7 +140,7 @@ export default class AiTagSuggester extends Component {
|
||||
if (tags?.length >= maxTags) {
|
||||
return this.toasts.error({
|
||||
class: "ai-suggestion-error",
|
||||
duration: 3000,
|
||||
duration: "short",
|
||||
data: {
|
||||
message: i18n("discourse_ai.ai_helper.suggest_errors.too_many_tags", {
|
||||
count: maxTags,
|
||||
|
@ -35,7 +35,7 @@ function initializeAiHelperTrigger(api) {
|
||||
|
||||
return toasts.error({
|
||||
class: "ai-proofread-error-toast",
|
||||
duration: 3000,
|
||||
duration: "short",
|
||||
data: {
|
||||
message: i18n("discourse_ai.ai_helper.no_content_error"),
|
||||
},
|
||||
|
@ -116,7 +116,7 @@ export default apiInitializer("1.25.0", (api) => {
|
||||
} catch (error) {
|
||||
toasts.error({
|
||||
class: "ai-image-caption-error-toast",
|
||||
duration: 3000,
|
||||
duration: "short",
|
||||
data: {
|
||||
message: extractError(error),
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user