@internetarchive/ia-book-actions 0.0.29-alpha30 → 0.0.29-alpha31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -126,16 +126,18 @@ export class LoanRenewHelper {
|
|
|
126
126
|
getMessageTexts(texts, time) {
|
|
127
127
|
let unitOfTime = 'second';
|
|
128
128
|
|
|
129
|
+
let toastTexts = texts;
|
|
129
130
|
let timeLeft = time;
|
|
130
|
-
let toastTexts = time;
|
|
131
131
|
|
|
132
132
|
if (timeLeft > 60) {
|
|
133
133
|
unitOfTime = 'minute';
|
|
134
134
|
timeLeft = 1;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
// replace remaining time
|
|
137
138
|
toastTexts = toastTexts?.replace(/#time/, timeLeft);
|
|
138
139
|
|
|
140
|
+
// replace unitsOfTime eg second vs seconds / minute vs /minutes
|
|
139
141
|
return toastTexts?.replace(
|
|
140
142
|
/#unitsOfTime/,
|
|
141
143
|
timeLeft !== 1 ? `${unitOfTime}s` : unitOfTime
|