Bläddra i källkod

:recycle: reverting to old title inject

tags/0.9.0
J 4 år sedan
förälder
incheckning
6d47d04776
1 ändrade filer med 2 tillägg och 15 borttagningar
  1. 2
    15
      vue-theme/src/store/modules/arrangements.js

+ 2
- 15
vue-theme/src/store/modules/arrangements.js Visa fil

@@ -56,21 +56,8 @@ const _arrangeByAlpha = (postsList, seenTitles) => {
56 56
         const lastWord = post.slug.split('-').filter(c => c).pop()
57 57
         const firstCharaOflastWord = lastWord[0]
58 58
         const firstCharaOfSortWord = post.sortname ? post.sortname[0] : 'z'
59
-        
60
-        let charaIndex = null
61
-        let otherIndex = null
62
-        const lastWordAlphaIndex = alphabet.indexOf(firstCharaOflastWord)
63
-        const altWordAlphaIndex = alphabet.indexOf(firstCharaOfSortWord)
64
-        if(lastWordAlphaIndex < altWordAlphaIndex) {
65
-            charaIndex = lastWordAlphaIndex
66
-            otherIndex = altWordAlphaIndex
67
-        } else if (lastWordAlphaIndex > altWordAlphaIndex) {
68
-            otherIndex = lastWordAlphaIndex
69
-            charaIndex = altWordAlphaIndex
70
-        }
71
-        if(seenTitles.includes(alphabet[charaIndex])) {
72
-            charaIndex = otherIndex
73
-        }
59
+        const charaIndex = alphabet.indexOf(firstCharaOflastWord) < alphabet.indexOf(firstCharaOfSortWord) ? alphabet.indexOf(firstCharaOflastWord) : alphabet.indexOf(firstCharaOfSortWord)
60
+
74 61
         storeTitle(alphabet[charaIndex])
75 62
         flatPacked.push(post)
76 63
     })

Laddar…
Avbryt
Spara