mirror of
				https://github.com/bra1n/townsquare.git
				synced 2025-10-21 16:55:12 +00:00 
			
		
		
		
	simplify session URLs
This commit is contained in:
		
							parent
							
								
									41af82cc5c
								
							
						
					
					
						commit
						7c0f31584c
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -253,7 +253,7 @@ export default {
 | 
			
		|||
        .then(({ state }) => {
 | 
			
		||||
          if (state === "granted" || state === "prompt") {
 | 
			
		||||
            const url = window.location.href.split("#")[0];
 | 
			
		||||
            const link = url + "#play/" + this.session.sessionId;
 | 
			
		||||
            const link = url + "#" + this.session.sessionId;
 | 
			
		||||
            navigator.clipboard.writeText(link);
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -736,9 +736,9 @@ export default store => {
 | 
			
		|||
  });
 | 
			
		||||
 | 
			
		||||
  // check for session Id in hash
 | 
			
		||||
  const [command, param] = window.location.hash.substr(1).split("/");
 | 
			
		||||
  if (command === "play") {
 | 
			
		||||
  const sessionId = window.location.hash.substr(1);
 | 
			
		||||
  if (sessionId) {
 | 
			
		||||
    store.commit("session/setSpectator", true);
 | 
			
		||||
    store.commit("session/setSessionId", param);
 | 
			
		||||
    store.commit("session/setSessionId", sessionId);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue