Skip to content

Commit df54a31

Browse files
committed
check for is web
1 parent 409b8b4 commit df54a31

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

templates/flutter/lib/client.dart.twig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,12 @@ class Client {
157157
} else {
158158
res = await http.request(path, data: params, options: options);
159159
}
160-
final cookieFallback = res.headers.value('X-Fallback-Cookies');
161-
if(cookieFallback != null) {
162-
print('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');
163-
prefs.setString('cookieFallback', cookieFallback);
160+
if(kIsWeb) {
161+
final cookieFallback = res.headers.value('X-Fallback-Cookies');
162+
if(cookieFallback != null) {
163+
print('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');
164+
prefs.setString('cookieFallback', cookieFallback);
165+
}
164166
}
165167
return res;
166168
} on DioError catch(e) {

0 commit comments

Comments
 (0)