22 <Generic :item =" item" >
33 <template #indicator >
44 <div class =" notifs" >
5- <strong v-if =" subscriptions > 0" class =" notif subscriptions" title =" Subscriptions" >
5+ <strong
6+ v-if =" subscriptions > 0"
7+ class =" notif subscriptions"
8+ title =" Subscriptions"
9+ >
610 {{ subscriptions }}
711 </strong >
812 <strong v-if =" unread > 0" class =" notif unread" title =" Unread" >
913 {{ unread }}
1014 </strong >
1115 <strong
12- v-if =" serverError" class =" notif errors"
13- title =" Connection error to the FreshRSS API, check url username and password in config.yml" >?</strong >
16+ v-if =" serverError"
17+ class =" notif errors"
18+ title =" Connection error to the FreshRSS API, check url username and password in config.yml"
19+ >?</strong
20+ >
1421 </div >
1522 </template >
1623 </Generic >
1724</template >
18-
25+
1926<script >
2027import service from " @/mixins/service.js" ;
2128import Generic from " ./Generic.vue" ;
@@ -45,28 +52,39 @@ export default {
4552 },
4653 methods: {
4754 fetchConfig : async function () {
48-
4955 if (! this .auth ) {
50- const match = await this .fetch (` /api/greader.php/accounts/ClientLogin?Email=${ this .item .username } &Passwd=${ this .item .password } ` , { method: ' GET' , cache: " no-cache" }, false )
51- .then (response => { return response .text (); })
52- .then (body => { return body .match (/ Auth=(([([a-z0-9 ] + )\/ ([([a-z0-9 ] + ))/ i ); });
53- if (match !== null )
54- this .auth = match[1 ];
56+ const match = await this .fetch (
57+ ` /api/greader.php/accounts/ClientLogin?Email=${ this .item .username } &Passwd=${ this .item .password } ` ,
58+ { method: " GET" , cache: " no-cache" },
59+ false ,
60+ )
61+ .then ((response ) => {
62+ return response .text ();
63+ })
64+ .then ((body ) => {
65+ return body .match (/ Auth=(([([a-z0-9 ] + )\/ ([([a-z0-9 ] + ))/ i );
66+ });
67+ if (match !== null ) this .auth = match[1 ];
5568 }
5669
5770 const headers = {
58- " Authorization" : ` GoogleLogin auth=${ this .auth } ` ,
71+ Authorization: ` GoogleLogin auth=${ this .auth } ` ,
5972 };
6073
61- this .fetch (` /api/greader.php/reader/api/0/subscription/list?output=json` , { headers })
74+ this .fetch (
75+ ` /api/greader.php/reader/api/0/subscription/list?output=json` ,
76+ { headers },
77+ )
6278 .then ((subscription ) => {
6379 this .subscriptions = subscription .subscriptions .length ;
6480 })
6581 .catch ((e ) => {
6682 console .error (e);
6783 this .serverError = true ;
6884 });
69- this .fetch (` /api/greader.php/reader/api/0/unread-count?output=json` , { headers })
85+ this .fetch (` /api/greader.php/reader/api/0/unread-count?output=json` , {
86+ headers,
87+ })
7088 .then ((unreadcount ) => {
7189 this .unread = unreadcount .max ;
7290 })
@@ -78,7 +96,7 @@ export default {
7896 },
7997};
8098 </script >
81-
99+
82100<style scoped lang="scss">
83101.notifs {
84102 position : absolute ;
@@ -104,4 +122,4 @@ export default {
104122 }
105123 }
106124}
107- </style >
125+ </style >
0 commit comments