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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-niki-loyalty",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "Niki The Cat Coffee Loyalty System - Earn points while studying on IEU Forum.",
5
5
  "main": "library.js",
6
6
  "nbbpm": {
@@ -114,16 +114,26 @@ $(document).ready(function () {
114
114
  // Fonksiyonu global yap
115
115
  window.updateFloatingWidget = updateFloatingWidget;
116
116
 
117
- // Sayfa yüklendiğinde sadece mevcut widget'ın puanını güncelle
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
- }, 1000);
125
+ }, 2000);
123
126
 
124
127
  // Her sayfa değişiminde widget puanını güncelle
125
- $(window).on('action:ajaxify.end', function () {
126
- if (app.user && app.user.uid) {
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
  });