44 * See License-AGPL.txt in the project root for license information.
55 */
66
7- import { GitpodClient , GitpodServer , GitpodServerPath , GitpodService , GitpodServiceImpl , User } from '@gitpod/gitpod-protocol' ;
7+ import { GitpodClient , GitpodServer , GitpodServerPath , GitpodService , GitpodServiceImpl } from '@gitpod/gitpod-protocol' ;
88import { WebSocketConnectionProvider } from '@gitpod/gitpod-protocol/lib/messaging/browser/connection' ;
99import { createWindowMessageConnection } from '@gitpod/gitpod-protocol/lib/messaging/browser/window-connection' ;
1010import { JsonRpcProxy , JsonRpcProxyFactory } from '@gitpod/gitpod-protocol/lib/messaging/proxy-factory' ;
1111import { GitpodHostUrl } from '@gitpod/gitpod-protocol/lib/util/gitpod-host-url' ;
1212import { log } from '@gitpod/gitpod-protocol/lib/util/logging' ;
1313
14- export const gitpodHostUrl = new GitpodHostUrl ( ( window as any ) . PREVIEW_URL || window . location . toString ( ) ) ;
14+ // export const gitpodHostUrl = new GitpodHostUrl("https://at-react.staging.gitpod-dev.com/");
15+ export const gitpodHostUrl = new GitpodHostUrl ( window . location . toString ( ) ) ;
1516
1617function createGitpodService < C extends GitpodClient , S extends GitpodServer > ( ) {
1718 let proxy : JsonRpcProxy < S > ;
@@ -43,37 +44,12 @@ function createGitpodService<C extends GitpodClient, S extends GitpodServer>() {
4344}
4445
4546
46-
47- export class AppService {
48- constructor ( protected gitpodService : GitpodService ) {
49- }
50-
51- protected userPromise : Promise < User > | undefined ;
52- async getOrLoadUser ( ) {
53- if ( ! this . userPromise ) {
54- this . userPromise = this . gitpodService . server . getLoggedInUser ( ) ;
55- }
56- return this . userPromise ;
57- }
58- async reloadUser ( ) {
59- this . userPromise = undefined ;
60- return this . getOrLoadUser ( ) ;
61- }
62-
63- async getAuthProviders ( ) {
64- return this . gitpodService . server . getAuthProviders ( ) ;
65- }
66-
67- }
68-
6947let gitpodService : GitpodService ;
70- let service : AppService ;
7148
7249const reconnect = ( ) => {
7350 gitpodService = createGitpodService ( ) ;
74- service = new AppService ( gitpodService ) ;
7551}
7652
7753reconnect ( ) ;
7854
79- export { service , gitpodService , reconnect } ;
55+ export { gitpodService , reconnect } ;
0 commit comments