The showLoading and showUndo functions somewhat "ignore" isHTML = true, because they don't simply pass the text argument to showMessage, which itself just forwards it to Toastify, but they create a new element and set its innerText property to the value of text and then pass the whole element to showMessage.
|
const loaderContent = document.createElement('span') |
|
loaderContent.classList.add('toast-loader-container') |
|
loaderContent.innerText = text |
|
loaderContent.appendChild(loader) |
|
|
|
return showMessage(loaderContent, { |
|
...options, |
|
close: false, |
|
timeout: TOAST_PERMANENT_TIMEOUT, |
|
type: ToastType.LOADING, |
|
}) |
I think it would be fine to do
const loaderContent = document.createElement('div')
loaderContent[options.isHTML ? 'innerHTML' : 'innerText'] = text
The containers are flex containers, so I think it won't be a problem
|
.toast-loader-container, |
|
.toast-undo-container { |
|
display: flex; |
|
align-items: center; |
|
width: 100%; |
|
} |
If you don't want to change this, I think it would be a good idea to at least remove isHTML from the options
export function showLoading(text: string, options?: Omit<ToastOptions, 'isHTML'>): Toast { }
The
showLoadingandshowUndofunctions somewhat "ignore"isHTML = true, because they don't simply pass thetextargument toshowMessage, which itself just forwards it toToastify, but they create a new element and set itsinnerTextproperty to the value oftextand then pass the whole element toshowMessage.nextcloud-dialogs/lib/toast.ts
Lines 213 to 223 in c32717e
I think it would be fine to do
The containers are flex containers, so I think it won't be a problem
nextcloud-dialogs/styles/toast.scss
Lines 23 to 28 in c32717e
If you don't want to change this, I think it would be a good idea to at least remove
isHTMLfrom the options