@@ -66,10 +66,8 @@ const DEFAULT_TIP_CONFIG = Object.freeze({
6666} ) ;
6767
6868/**
69- * is a string if not initialized/loaded yet
70- *
7169 * @private
72- * @type {TipObject[]|string }
70+ * @type {TipObject[] }
7371 * @see {@link tips }
7472 */
7573let tips ;
@@ -294,15 +292,6 @@ export function setContext(newContext) {
294292 * @returns {Promise }
295293 */
296294export async function showRandomTip ( ) {
297- // load tips if not already loaded
298- if ( ! tips || ! Array . isArray ( tips ) ) {
299- const tipsToShow = import ( tips ) ; // ES6 dynamic modules, requires Firefoy >= 67
300-
301- // use local shallow copy, so we can modify it
302- // inner objects won't be modified, so we do not need to deep-clone it.
303- tips = tipsToShow . slice ( ) ;
304- }
305-
306295 // only try to select tip, if one is even available
307296 if ( tips . length === 0 ) {
308297 console . info ( "no tips to show available anymore" ) ;
@@ -351,16 +340,13 @@ export function showRandomTipIfWanted() {
351340 * Initialises the module.
352341 *
353342 * @public
354- * @param {TipObject[]|string } [tipsToShow="/common/modules/data/Tips.js"]
355- * optionally, the tips object to init
356- * or the path to lazy-load the data from
343+ * @param {TipObject[] } tipsToShow the tips object to init
357344 * @returns {Promise.<void> }
358345 */
359- export function init ( tipsToShow = "/common/modules/data/Tips.js" ) {
360- if ( tipsToShow ) {
361- // use local shallow copy, if it si an array or save path
362- tips = Array . isArray ( tipsToShow ) ? tipsToShow . slice ( ) : tipsToShow ;
363- }
346+ export function init ( tipsToShow ) {
347+ // use local shallow copy, so we can modify it
348+ // inner objects won't be modified, so we do not need to deep-clone it.
349+ tips = tipsToShow . slice ( ) ;
364350
365351 // load function
366352 // We need to assign it here to make it testable.
0 commit comments