word-games-theme 1.7.7 → 1.7.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e66f6967ca9e33e605ea9052f00d0ba82280887b085bf3864d730bb02b1ad73c
4
- data.tar.gz: e7f0e660e2a3926bdae20613ca8301f1db11af54aa07ae007b7cb160ab8625e9
3
+ metadata.gz: 4f6c28a1bd607ef9b459ba346567684172ece53a55d84ba341cc59fe2cabff7d
4
+ data.tar.gz: ef2e9b56926c18ec63be7765f1931df184556349760f8fb2afca3044f68a4880
5
5
  SHA512:
6
- metadata.gz: db9c62b33fc48ebabac566946a3a4060d6bb7830615a68cbacf1d0adba7a588f125f152c6eac384c82a85e3d0adfd8d5a17dc075f908f8fc2e8a4381512e9b31
7
- data.tar.gz: f859f5dda6fd82708c0f054644bc25b9efd1b3b558cf51dabd1a036ff4d00e760cf836ca52fcbf346ea5740c6f0e019eefad9794bf0b2ec1d39b45cb8f105559
6
+ metadata.gz: 5b345ce63b46960bd3588f46d26a7f2f07f730b11b4d908e38e6a747f81f2d1ddaea226082c74094262291e21f539cb3f5b155be503dce52e3412355fa9bf7bf
7
+ data.tar.gz: 58ab9a3248c9a8fc99c4983205341d2d913ce3b718da58a32f949b1a04b5c400211d28806e9dd8f3185401e929de3625ede6fbaa222dc8e9b95be669f13acb70
@@ -71,8 +71,16 @@ const getData = async (e) => {
71
71
  : (m_length = max_word_length);
72
72
 
73
73
  // m_length is maximum word length
74
- data = getCombo(data, m_length);
75
- console.timeEnd("time taken");
74
+ if (
75
+ data !=
76
+ "No combination of these letters creates a word in the Engish language."
77
+ ) {
78
+ data = getCombo(data, m_length);
79
+ } else {
80
+ subResult.innerHTML = "";
81
+ errorMessage.style.display = "block";
82
+ document.querySelector(".heading-result").style.display = "none";
83
+ }
76
84
  };
77
85
 
78
86
  form.addEventListener("submit", getData);
@@ -101,7 +109,10 @@ async function getCombo(arr, m_words) {
101
109
  return newWord;
102
110
  });
103
111
  });
104
- displayUi(resultArr, combinations, userValue, m_words, scrabbleWordArr);
112
+
113
+ if (combinations.length > 0) {
114
+ displayUi(resultArr, combinations, userValue, m_words, scrabbleWordArr);
115
+ }
105
116
  }
106
117
 
107
118
  const equalsCheck = (a, b) => {
@@ -245,10 +256,14 @@ const getMatchedChars = (str, userInput) => {
245
256
  };
246
257
  //n is max word
247
258
  async function displayUi(newdata, combinations, userValue, n, wordArr) {
248
- // console.log("printed for firsTime");
249
-
250
259
  if (newdata.length == []) {
251
260
  if (found.size == 0) {
261
+ subResult.innerHTML = "";
262
+ errorMessage.style.display = "block";
263
+ document.querySelector(".heading-result").style.display = "none";
264
+ }
265
+ if (n > 2) {
266
+ subResult.innerHTML = "";
252
267
  errorMessage.style.display = "block";
253
268
  document.querySelector(".heading-result").style.display = "none";
254
269
  }
@@ -297,23 +312,27 @@ async function displayUi(newdata, combinations, userValue, n, wordArr) {
297
312
  wordArr = wordArr.filter(
298
313
  (w) => w.length < Math.round(userValue.length / 2)
299
314
  );
300
- // console.time("combination time");
315
+
301
316
  var data = getComboWords(combinations, wordArr, userValue);
302
- // console.timeEnd("combination time");
317
+
303
318
  n--;
304
319
  console.log("calling display ui from recursion");
305
320
  if (data.length != 0) {
306
321
  displayUi(resultArr, data, userValue, n, wordArr);
307
322
  } else {
323
+ if (found.size == 0 || main.innerHTML == "") {
324
+ subResult.innerHTML = "";
325
+ errorMessage.style.display = "block";
326
+ document.querySelector(".heading-result").style.display = "none";
327
+ }
328
+
308
329
  found.clear();
309
- // console.log("refreshing");
310
330
  wlength != null ? (m_words = wlength) : (m_words = +max_words.value);
311
331
  scrabbleWordArr = [];
312
332
  lazyLoader.style.display = "none";
313
333
  }
314
334
  } else {
315
335
  found.clear();
316
- // console.log("refreshing");
317
336
  wlength != null ? (m_words = wlength) : (m_words = +max_words.value);
318
337
  scrabbleWordArr = [];
319
338
  lazyLoader.style.display = "none";