@jiggai/kitchen-plugin-marketing 0.2.7 → 0.2.8
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/dist/tabs/accounts.js +14 -3
- package/package.json +1 -1
package/dist/tabs/accounts.js
CHANGED
|
@@ -115,14 +115,25 @@
|
|
|
115
115
|
setShowPostizSetup(false);
|
|
116
116
|
void detectAll();
|
|
117
117
|
};
|
|
118
|
+
const getStoredPostiz = () => {
|
|
119
|
+
try {
|
|
120
|
+
const stored = localStorage.getItem(`ck-postiz-${teamId}`);
|
|
121
|
+
if (stored) return JSON.parse(stored);
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
};
|
|
118
126
|
const detectAll = async () => {
|
|
119
127
|
setDetecting(true);
|
|
120
128
|
setError(null);
|
|
121
129
|
try {
|
|
130
|
+
const stored = getStoredPostiz();
|
|
131
|
+
const key = postizKey || stored?.apiKey || "";
|
|
132
|
+
const url = postizUrl || stored?.baseUrl || "https://api.postiz.com/public/v1";
|
|
122
133
|
const headers = {};
|
|
123
|
-
if (
|
|
124
|
-
headers["x-postiz-api-key"] =
|
|
125
|
-
headers["x-postiz-base-url"] =
|
|
134
|
+
if (key) {
|
|
135
|
+
headers["x-postiz-api-key"] = key;
|
|
136
|
+
headers["x-postiz-base-url"] = url;
|
|
126
137
|
}
|
|
127
138
|
const res = await fetch(`${apiBase}/providers?team=${encodeURIComponent(teamId)}`, { headers });
|
|
128
139
|
const json = await res.json();
|