Messaging system #150
@ -15,6 +15,7 @@ import { ref } from 'vue'
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
export const discussionsList = ref();
 | 
					export const discussionsList = ref();
 | 
				
			||||||
export const currentDiscussion = ref([]);
 | 
					export const currentDiscussion = ref([]);
 | 
				
			||||||
 | 
					let timerSet = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function createDiscussion(name){
 | 
					export async function createDiscussion(name){
 | 
				
			||||||
@ -50,6 +51,10 @@ async function fetchDiscussions(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export async function fetchDiscussion(id){
 | 
					export async function fetchDiscussion(id){
 | 
				
			||||||
	currentDiscussion.value = await restGet("/discussion/" + id);
 | 
						currentDiscussion.value = await restGet("/discussion/" + id);
 | 
				
			||||||
 | 
						if(!timerSet){
 | 
				
			||||||
 | 
							timerSet = true;
 | 
				
			||||||
 | 
							setTimeout(() => {timerSet = false;fetchDiscussion(currentDiscussion.value.id)} , 5000);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
await fetchDiscussions();
 | 
					await fetchDiscussions();
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user