ssb: Show the progress indicator more consistently.
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build Tilde Friends / Build-All (push) Successful in 30m54s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build Tilde Friends / Build-All (push) Successful in 30m54s
				
			This commit is contained in:
		| @@ -1,5 +1,5 @@ | |||||||
| { | { | ||||||
| 	"type": "tildefriends-app", | 	"type": "tildefriends-app", | ||||||
| 	"emoji": "🦀", | 	"emoji": "🦀", | ||||||
| 	"previous": "&JRzG7VkGOP1IzLdknli36Gr4PddIvkOEKt7L6IMw/lk=.sha256" | 	"previous": "&nvdIMraZtEjSegUCd4b5hLz6Csn5YNV+vyJWu7QAE3I=.sha256" | ||||||
| } | } | ||||||
|   | |||||||
| @@ -57,6 +57,7 @@ class TfElement extends LitElement { | |||||||
| 		tfrpc.rpc.getHash().then((hash) => self.set_hash(hash)); | 		tfrpc.rpc.getHash().then((hash) => self.set_hash(hash)); | ||||||
| 		tfrpc.register(function hashChanged(hash) { | 		tfrpc.register(function hashChanged(hash) { | ||||||
| 			self.set_hash(hash); | 			self.set_hash(hash); | ||||||
|  | 			self.reset_progress(); | ||||||
| 		}); | 		}); | ||||||
| 		tfrpc.register(async function notifyNewMessage(id) { | 		tfrpc.register(async function notifyNewMessage(id) { | ||||||
| 			await self.fetch_new_message(id); | 			await self.fetch_new_message(id); | ||||||
| @@ -459,7 +460,9 @@ class TfElement extends LitElement { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	update_progress() { | 	update_progress() { | ||||||
| 		if (!this.loading_latest && !this.loading_latest_scheduled) { | 		if (!this.loading_latest && | ||||||
|  | 			!this.loading_latest_scheduled && | ||||||
|  | 			!this.shadowRoot.getElementById('tf-tab-news')?.is_loading()) { | ||||||
| 			this.progress = undefined; | 			this.progress = undefined; | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| @@ -622,6 +625,7 @@ class TfElement extends LitElement { | |||||||
| 					@channelsetunread=${this.channel_set_unread} | 					@channelsetunread=${this.channel_set_unread} | ||||||
| 					@refresh=${this.refresh} | 					@refresh=${this.refresh} | ||||||
| 					@toggle_stay_connected=${this.toggle_stay_connected} | 					@toggle_stay_connected=${this.toggle_stay_connected} | ||||||
|  | 					@loadmessages=${this.reset_progress} | ||||||
| 					.connections=${this.connections} | 					.connections=${this.connections} | ||||||
| 					.private_messages=${this.private_messages} | 					.private_messages=${this.private_messages} | ||||||
| 					.recent_reactions=${this.recent_reactions} | 					.recent_reactions=${this.recent_reactions} | ||||||
|   | |||||||
| @@ -106,6 +106,12 @@ class TfTabNewsFeedElement extends LitElement { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	async fetch_messages(start_time, end_time) { | 	async fetch_messages(start_time, end_time) { | ||||||
|  | 		this.dispatchEvent( | ||||||
|  | 			new CustomEvent('loadmessages', { | ||||||
|  | 				bubbles: true, | ||||||
|  | 				composed: true, | ||||||
|  | 			}) | ||||||
|  | 		); | ||||||
| 		this.time_loading = [start_time, end_time]; | 		this.time_loading = [start_time, end_time]; | ||||||
| 		let result; | 		let result; | ||||||
| 		const k_max_results = 64; | 		const k_max_results = 64; | ||||||
|   | |||||||
| @@ -180,6 +180,10 @@ class TfTabNewsElement extends LitElement { | |||||||
| 		await this.check_peer_exchange(); | 		await this.check_peer_exchange(); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	is_loading() { | ||||||
|  | 		return this.shadowRoot?.getElementById('news')?.loading; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	render_sidebar() { | 	render_sidebar() { | ||||||
| 		return html` | 		return html` | ||||||
| 			<div | 			<div | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user