nodebb-plugin-niki-loyalty 1.3.13 → 1.3.14
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 +1 -1
- package/static/lib/client.js +15 -5
package/package.json
CHANGED
package/static/lib/client.js
CHANGED
|
@@ -114,16 +114,26 @@ $(document).ready(function () {
|
|
|
114
114
|
// Fonksiyonu global yap
|
|
115
115
|
window.updateFloatingWidget = updateFloatingWidget;
|
|
116
116
|
|
|
117
|
-
//
|
|
117
|
+
// Login sonrası redirect sorununu önlemek için erken API çağrısı yapma
|
|
118
|
+
var isJustLoggedIn = window.location.search.includes('loggedin');
|
|
119
|
+
|
|
120
|
+
// Sayfa yüklendiğinde widget puanını güncelle (login değilse)
|
|
118
121
|
setTimeout(function () {
|
|
119
|
-
if (app.user && app.user.uid) {
|
|
122
|
+
if (app.user && app.user.uid && !isJustLoggedIn) {
|
|
120
123
|
updateFloatingWidget();
|
|
121
124
|
}
|
|
122
|
-
},
|
|
125
|
+
}, 2000);
|
|
123
126
|
|
|
124
127
|
// Her sayfa değişiminde widget puanını güncelle
|
|
125
|
-
$(window).on('action:ajaxify.end', function () {
|
|
126
|
-
|
|
128
|
+
$(window).on('action:ajaxify.end', function (ev, data) {
|
|
129
|
+
// Login sayfasından geliyorsa bekle
|
|
130
|
+
if (data && data.url && data.url.includes('login')) {
|
|
131
|
+
setTimeout(function () {
|
|
132
|
+
if (app.user && app.user.uid) {
|
|
133
|
+
updateFloatingWidget();
|
|
134
|
+
}
|
|
135
|
+
}, 3000);
|
|
136
|
+
} else if (app.user && app.user.uid) {
|
|
127
137
|
updateFloatingWidget();
|
|
128
138
|
}
|
|
129
139
|
});
|