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:
Keegan George 2025-06-20 12:42:08 -07:00 committed by GitHub
parent a4194d3fb2
commit 238538c405
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 12 additions and 12 deletions

View File

@ -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",

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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)) {

View File

@ -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"),
}, },

View File

@ -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,

View File

@ -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"),
}, },

View File

@ -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),
}, },