display percentage completion in the extension icon
This commit is contained in:
		
							parent
							
								
									7d20170c25
								
							
						
					
					
						commit
						b8c0bf39e9
					
				
					 1 changed files with 9 additions and 3 deletions
				
			
		|  | @ -39,13 +39,19 @@ class IconIndicator { | ||||||
| 										"BadgeBackgroundColor": ICON_COLORS[`error`] | 										"BadgeBackgroundColor": ICON_COLORS[`error`] | ||||||
| 									}, {"tabId": ID}) : false; | 									}, {"tabId": ID}) : false; | ||||||
| 	 | 	 | ||||||
| 								if ((STATUS[`done`] && (typeof STATUS[`done`]).includes(`num`)) ? STATUS[`done`] >= 1 : false) { | 								if (STATUS[`done`] && (typeof STATUS[`done`]).includes(`num`)) { | ||||||
| 									global.read([`sites`, LOCATION, `analysis`, `Rating`, `Trust`]).then(async (RESULTS) => { | 									(STATUS[`done`] >= 1) | ||||||
|  | 										? global.read([`sites`, LOCATION, `analysis`, `Rating`, `Trust`]).then(async (RESULTS) => { | ||||||
| 										(RESULTS) ? BrowserIcon.set({ | 										(RESULTS) ? BrowserIcon.set({ | ||||||
| 												"BadgeText": await (new texts(`extensionIcon_product_`.concat(RESULTS))).symbol, | 												"BadgeText": await (new texts(`extensionIcon_product_`.concat(RESULTS))).symbol, | ||||||
| 												"BadgeBackgroundColor": ICON_COLORS[`product_`.concat(RESULTS)] | 												"BadgeBackgroundColor": ICON_COLORS[`product_`.concat(RESULTS)] | ||||||
| 											}, {"tabId": ID}) : false; | 											}, {"tabId": ID}) : false; | ||||||
| 										}) | 										}) | ||||||
|  | 										: ((STATUS[`done`] > 0) | ||||||
|  | 											? BrowserIcon.set({ | ||||||
|  | 												"BadgeText": String(parseFloat(STATUS[`done`] * 100)).concat(`%`), | ||||||
|  | 												"BadgeBackgroundColor": ICON_COLORS[`loading`]}) | ||||||
|  | 											: false); | ||||||
| 								}; | 								}; | ||||||
| 							}; | 							}; | ||||||
| 						}); | 						}); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue