This repository was archived by the owner on Apr 12, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class ImageStore {
7171 // Remove file if accessed 7 days ago.
7272 const p = path . join ( this . dir , f )
7373 const stats = fs . statSync ( p )
74- if ( now - stats . atimeMs > 1000 )
74+ if ( now - stats . atimeMs > 1000 * 3600 * 24 * 7 )
7575 fs . unlinkSync ( p )
7676 }
7777 } catch ( e ) {
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ const SlackDirectMessage = require('./slack-direct-messsage')
88const SlackReaction = require ( './slack-reaction' )
99const SlackUser = require ( './slack-user' )
1010
11- const imageStore = require ( '../../controller/image-store' )
12-
1311function compareChannel ( a , b ) {
1412 const nameA = a . name . toUpperCase ( )
1513 const nameB = b . name . toUpperCase ( )
@@ -109,7 +107,7 @@ class SlackAccount extends Account {
109107 async ready ( data ) {
110108 // Update current team information.
111109 const { team} = await this . rtm . webClient . team . info ( )
112- this . icon = await imageStore . fetchImage ( team . icon . image_132 )
110+ this . icon = team . icon . image_132
113111 this . url = `https://${ team . domain } .slack.com`
114112 this . onUpdateInfo . dispatch ( this )
115113 // Fetch users.
Original file line number Diff line number Diff line change 11const gui = require ( 'gui' )
22
3+ const imageStore = require ( '../controller/image-store' )
4+
35const FOCUS_BAR_COLOR = process . platform === 'darwin' ? '#FFF' : '#938E92'
46
57function RoundedCornerPath ( painter , r , radius ) {
@@ -52,9 +54,9 @@ class AccountButton {
5254 this . subscription . onUpdateReadState . detach ( )
5355 }
5456
55- updateInfo ( ) {
57+ async updateInfo ( ) {
5658 if ( this . account . icon )
57- this . image = gui . Image . createFromPath ( this . account . icon )
59+ this . image = gui . Image . createFromPath ( await imageStore . fetchImage ( this . account . icon ) )
5860 this . view . schedulePaint ( )
5961 }
6062
You can’t perform that action at this time.
0 commit comments