...
 
Commits (10)
......@@ -81,6 +81,8 @@ e2e:chrome:
build:review:
stage: build
before_script:
- sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script:
- npm ci && npm install -g gulp-cli
- npm run postinstall
......@@ -97,6 +99,8 @@ build:review:
build:production:en:
stage: build
before_script:
- sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script:
- npm ci && npm install -g gulp-cli
- npm run postinstall
......@@ -113,6 +117,8 @@ build:production:en:
build:production:i18n:
stage: build
before_script:
- sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script:
- npm ci && npm install -g gulp-cli
- npm run postinstall
......@@ -127,6 +133,17 @@ build:production:i18n:
- master
- test/gitlab-ci
.sentry_prepare: &sentry_prepare
stage: prepare
image: getsentry/sentry-cli
script:
- echo "Create a new release $CI_COMMIT_SHA"
- sentry-cli releases new $CI_COMMIT_SHA
- sentry-cli releases set-commits --auto $CI_COMMIT_SHA
- sentry-cli releases files $CI_COMMIT_SHA upload-sourcemaps $CI_PROJECT_DIR/dist/en -x .js -x .map --validate --verbose --rewrite --strip-common-prefix
- sentry-cli releases finalize $CI_COMMIT_SHA
- echo "Finalized release for $CI_COMMIT_SHA"
prepare:review:
stage: prepare
image: minds/ci:latest
......@@ -141,6 +158,15 @@ prepare:review:
- master
- test/gitlab-ci
prepare:review:sentry:
<<: *sentry_prepare
except:
refs:
- master
- test/gitlab-ci
dependencies:
- build:review
prepare:production:
stage: prepare
image: minds/ci:latest
......@@ -156,6 +182,16 @@ prepare:production:
- build:production:en
- build:production:i18n
prepare:production:sentry:
<<: *sentry_prepare
only:
refs:
- master
- test/gitlab-ci
dependencies:
- build:production:en
- build:production:i18n
review:start:
stage: review
image: minds/helm-eks:latest
......@@ -172,6 +208,8 @@ review:start:
--wait \
$CI_BUILD_REF_SLUG \
./helm-charts/minds"
# Update sentry
- sentry-cli releases deploys $CI_COMMIT_SHA new -e review-$CI_COMMIT_REF_SLUG
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
......@@ -214,6 +252,8 @@ staging:fpm:
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_STAGING_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
## Update sentry
- sentry-cli releases deploys $CI_COMMIT_SHA new -e $IMAGE_LABEL
only:
refs:
- master
......@@ -240,6 +280,8 @@ deploy:canary:
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_CANARY_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
## Update sentry
- sentry-cli releases deploys $CI_COMMIT_SHA new -e $IMAGE_LABEL
only:
refs:
- master
......@@ -266,6 +308,8 @@ deploy:production:
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_PRODUCTION_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
## Update sentry
- sentry-cli releases deploys $CI_COMMIT_SHA new -e $IMAGE_LABEL
only:
refs:
- master
......@@ -278,3 +322,4 @@ deploy:production:
url: https://www.minds.com
when: delayed
start_in: 2 hours # reduce? can always be deployed manually earlier too
......@@ -36,7 +36,11 @@
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": {
"hidden": true,
"scripts": true,
"styles": true
},
"extractCss": true,
"namedChunks": false,
"aot": true,
......
#!/bin/sh
export NODE_OPTIONS="--max-old-space-size=3584"
ng build --prod --vendor-chunk --output-path="$1/en/" --deploy-url="$2/en/" --build-optimizer=false --source-map=false
ng build --prod --vendor-chunk --output-path="$1/en/" --deploy-url="$2/en/" --build-optimizer=false
......@@ -1866,6 +1866,63 @@
}
}
},
"@sentry/browser": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.6.2.tgz",
"integrity": "sha512-Nm/W/5ra6+OQCWQkdd86vHjcYUjHCVqCzQyPasd6HE7SNlWe5euGVfFfDuUFsiDrMAG5uKfGYw5u/AqoweiQkQ==",
"requires": {
"@sentry/core": "5.6.2",
"@sentry/types": "5.6.1",
"@sentry/utils": "5.6.1",
"tslib": "^1.9.3"
}
},
"@sentry/core": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.6.2.tgz",
"integrity": "sha512-grbjvNmyxP5WSPR6UobN2q+Nss7Hvz+BClBT8QTr7VTEG5q89TwNddn6Ej3bGkaUVbct/GpVlI3XflWYDsnU6Q==",
"requires": {
"@sentry/hub": "5.6.1",
"@sentry/minimal": "5.6.1",
"@sentry/types": "5.6.1",
"@sentry/utils": "5.6.1",
"tslib": "^1.9.3"
}
},
"@sentry/hub": {
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.6.1.tgz",
"integrity": "sha512-m+OhkIV5yTAL3R1+XfCwzUQka0UF/xG4py8sEfPXyYIcoOJ2ZTX+1kQJLy8QQJ4RzOBwZA+DzRKP0cgzPJ3+oQ==",
"requires": {
"@sentry/types": "5.6.1",
"@sentry/utils": "5.6.1",
"tslib": "^1.9.3"
}
},
"@sentry/minimal": {
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.6.1.tgz",
"integrity": "sha512-ercCKuBWHog6aS6SsJRuKhJwNdJ2oRQVWT2UAx1zqvsbHT9mSa8ZRjdPHYOtqY3DoXKk/pLUFW/fkmAnpdMqRw==",
"requires": {
"@sentry/hub": "5.6.1",
"@sentry/types": "5.6.1",
"tslib": "^1.9.3"
}
},
"@sentry/types": {
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.6.1.tgz",
"integrity": "sha512-Kub8TETefHpdhvtnDj3kKfhCj0u/xn3Zi2zIC7PB11NJHvvPXENx97tciz4roJGp7cLRCJsFqCg4tHXniqDSnQ=="
},
"@sentry/utils": {
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.6.1.tgz",
"integrity": "sha512-rfgha+UsHW816GqlSRPlniKqAZylOmQWML2JsujoUP03nPu80zdN43DK9Poy/d9OxBxv0gd5K2n+bFdM2kqLQQ==",
"requires": {
"@sentry/types": "5.6.1",
"tslib": "^1.9.3"
}
},
"@types/jasmine": {
"version": "2.8.14",
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.8.14.tgz",
......@@ -2756,7 +2813,7 @@
"async-limiter": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
"integrity": "sha1-ePrtjD0HSrgfIrTphdeehzj3IPg="
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
},
"async-settle": {
"version": "1.0.0",
......@@ -3104,7 +3161,7 @@
"bencode": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/bencode/-/bencode-2.0.0.tgz",
"integrity": "sha1-5y5rNpHYJL0D6nqp11LNHUmlACc=",
"integrity": "sha512-wr2HwwrUpfB5c68zmAudOltC7rZ1G0+lQOcnuEcfIM3AWAVnB3rHI3nlgd/2CWTfQ3w3zagKt89zni/M+VLZ8g==",
"requires": {
"safe-buffer": "^5.1.1"
}
......@@ -11188,7 +11245,7 @@
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"useragent": {
......@@ -11872,7 +11929,7 @@
"lodash.mergewith": {
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz",
"integrity": "sha1-Y5BX5ybDr72z59QnQcqo1uQzWSc=",
"integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==",
"dev": true
},
"lodash.once": {
......@@ -12531,7 +12588,7 @@
"mimic-fn": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
"integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=",
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
"dev": true
},
"mimic-response": {
......@@ -12636,7 +12693,7 @@
"mixin-deep": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz",
"integrity": "sha1-pJ5yaNzhoNlpjkUybFYm3zVD0P4=",
"integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==",
"dev": true,
"requires": {
"for-in": "^1.0.2",
......@@ -12646,7 +12703,7 @@
"is-extendable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
"integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=",
"integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
"dev": true,
"requires": {
"is-plain-object": "^2.0.4"
......@@ -12762,7 +12819,7 @@
"mp4-stream": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/mp4-stream/-/mp4-stream-2.0.3.tgz",
"integrity": "sha1-MKzuB3CdMj+NzYegezzpw8S/s2Q=",
"integrity": "sha512-5NzgI0+bGakoZEwnIYINXqB3mnewkt3Y7jcvkXsTubnCNUSdM8cpP0Vemxf6FLg0qUN8fydTgNMVAc3QU8B92g==",
"requires": {
"buffer-alloc": "^1.1.0",
"inherits": "^2.0.1",
......@@ -13274,7 +13331,7 @@
"normalize-package-data": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
"integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=",
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
"dev": true,
"requires": {
"hosted-git-info": "^2.1.4",
......@@ -15028,7 +15085,7 @@
"random-access-file": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/random-access-file/-/random-access-file-2.0.1.tgz",
"integrity": "sha1-3CLeeScOmoTLNqJBm3WXJZMNyus=",
"integrity": "sha512-nb4fClpzoUY+v1SHrro+9yykN90eMA1rc+xM39tnZ5R3BgFY+J/NxPZ0KuUpishEsvnwou9Fvm2wa3cjeuG7vg==",
"requires": {
"mkdirp": "^0.5.1",
"random-access-storage": "^1.1.1"
......@@ -16193,7 +16250,7 @@
"set-value": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
"integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=",
"integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==",
"dev": true,
"requires": {
"extend-shallow": "^2.0.1",
......@@ -18452,7 +18509,7 @@
"type-is": {
"version": "1.6.16",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
"integrity": "sha1-+JzjQVQcZysl7nrjxz3uOyvlAZQ=",
"integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
"dev": true,
"requires": {
"media-typer": "0.3.0",
......
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule, Injectable, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { CaptchaModule } from './modules/captcha/captcha.module';
import { environment } from '../environments/environment';
import { Minds } from './app.component';
......@@ -59,6 +60,23 @@ import { CanaryModule } from './modules/canary/canary.module';
import { HttpClientModule } from "@angular/common/http";
import { AnalyticsModule } from "./modules/analytics/analytics.module";
import * as Sentry from "@sentry/browser";
Sentry.init({
dsn: "https://3f786f8407e042db9053434a3ab527a2@sentry.io/1538008", // TODO: do not hardcard
release: environment.version,
environment: (<any>window.Minds).environment || 'development',
});
@Injectable()
export class SentryErrorHandler implements ErrorHandler {
constructor() {}
handleError(error) {
// const eventId = Sentry.captureException(error.originalError || error);
// Sentry.showReportDialog({ eventId });
}
}
@NgModule({
bootstrap: [
Minds
......@@ -122,6 +140,7 @@ import { AnalyticsModule } from "./modules/analytics/analytics.module";
ChannelsModule,
],
providers: [
{ provide: ErrorHandler, useClass: SentryErrorHandler },
MindsAppRoutingProviders,
MINDS_PROVIDERS,
MINDS_PLUGIN_PROVIDERS,
......
......@@ -56,10 +56,10 @@ export class SortSelectorComponent implements OnInit, OnDestroy, AfterViewInit {
id: '30d',
label: '30d',
},
{
/*{
id: '1y',
label: '1y'
},
},*/
];
customTypes: Array<{ id, label, icon? }> = [
......
......@@ -61,7 +61,7 @@ export class EntitiesService {
}
for (const feedItem of feed) {
if (blockedGuids.indexOf(feedItem.owner_guid) < 0)
if (!blockedGuids || blockedGuids.indexOf(feedItem.owner_guid) < 0)
entities.push(this.entities.get(feedItem.urn));
}
......@@ -153,7 +153,7 @@ export class EntitiesService {
if (!this.entities.has(urn)) {
this.entities.set(urn, new BehaviorSubject(null));
}
this.entities.get(urn).error("Not found");
console.warn(`Entity ${urn} not found`);
}
static _(client: Client, blockListService: BlockListService) {
......
......@@ -191,9 +191,6 @@ export class Activity implements OnInit {
@Input() set boostToggle(toggle: boolean) {
//if(toggle)
// this.showBoost();
if(this.activity.custom_type === 'video') {
this.player.pause();
}
return;
}
......
......@@ -80,10 +80,6 @@ export class MindsVideoTorrentPlayer implements OnInit, AfterViewInit, OnDestroy
this._emitCanPlayThrough();
};
protected _dblClick = () => {
this.requestFullScreen();
};
protected _onError = e => {
this.loading = false;
this.detectChanges();
......@@ -131,7 +127,6 @@ export class MindsVideoTorrentPlayer implements OnInit, AfterViewInit, OnDestroy
ngOnInit() {
const player = this.getPlayer();
player.addEventListener('dblclick', this._dblClick);
player.addEventListener('playing', this._emitPlay);
player.addEventListener('pause', this._emitPause);
player.addEventListener('ended', this._emitEnd);
......@@ -161,7 +156,6 @@ export class MindsVideoTorrentPlayer implements OnInit, AfterViewInit, OnDestroy
const player = this.getPlayer();
if (player) {
player.removeEventListener('dblclick', this._dblClick);
player.removeEventListener('playing', this._emitPlay);
player.removeEventListener('pause', this._emitPause);
player.removeEventListener('ended', this._emitEnd);
......
import { Component, ElementRef, Input, Output, EventEmitter, ViewChild, ChangeDetectorRef, OnDestroy } from '@angular/core';
import { Component, ElementRef, Input, Output, EventEmitter, ViewChild, ChangeDetectorRef, OnDestroy, HostListener } from '@angular/core';
import { Router } from '@angular/router';
import { trigger, state, style, animate, transition } from '@angular/animations';
import { MindsVideoProgressBar } from './progress-bar/progress-bar.component';
......@@ -17,7 +17,7 @@ import isMobile from '../../../../helpers/is-mobile';
host: {
'(mouseenter)': 'onMouseEnter()',
'(mouseleave)': 'onMouseLeave()',
'[class.clickable]':'canPlayThrough'
'[class.clickable]':'metadataLoaded'
},
templateUrl: 'video.component.html',
animations: [
......@@ -44,6 +44,8 @@ export class MindsVideoComponent implements OnDestroy {
@Input() poster: string = '';
@Input() isActivity: boolean = false;
@Input() isModal: boolean = false;
// @Input() isTheatre: boolean = false;
@Output('finished') finished: EventEmitter<any> = new EventEmitter();
......@@ -83,6 +85,7 @@ export class MindsVideoComponent implements OnDestroy {
stopSeekerTimeout: any = null;
metadataLoaded: boolean = false;
canPlayThrough: boolean = false;
isFullscreen: boolean = false;
current: { type: 'torrent' | 'direct-http', src: string };
protected candidates: SourceCandidates = new SourceCandidates();
......@@ -395,7 +398,7 @@ export class MindsVideoComponent implements OnDestroy {
}
requestMediaModal() {
if (!this.canPlayThrough) {
if (!this.metadataLoaded) {
return;
}
......@@ -421,6 +424,61 @@ export class MindsVideoComponent implements OnDestroy {
this.cd.markForCheck();
this.cd.detectChanges();
}
// * FULLSCREEN * --------------------------------------------------------------------------------
// Listen for fullscreen change event in case user enters/exits full screen without clicking button
@HostListener('document:fullscreenchange', ['$event'])
@HostListener('document:webkitfullscreenchange', ['$event'])
@HostListener('document:mozfullscreenchange', ['$event'])
@HostListener('document:MSFullscreenChange', ['$event'])
onFullscreenChange(event) {
if ( !document.fullscreenElement &&
!document['webkitFullscreenElement'] &&
!document['mozFullScreenElement'] &&
!document['msFullscreenElement'] ) {
this.isFullscreen = false;
} else {
this.isFullscreen = true;
}
}
toggleFullscreen() {
const elem = document.querySelector('m-video');
// this.fullscreenHovering = false;
// If fullscreen is not already enabled
if ( !document['fullscreenElement'] &&
!document['webkitFullscreenElement'] &&
!document['mozFullScreenElement'] &&
!document['msFullscreenElement'] ) {
// Request full screen
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem['webkitRequestFullscreen']) {
elem['webkitRequestFullscreen']();
} else if (elem['mozRequestFullScreen']) {
elem['mozRequestFullScreen']();
} else if (elem['msRequestFullscreen']) {
elem['msRequestFullscreen']();
}
this.isFullscreen = true;
return;
}
// If fullscreen is already enabled, exit it
if ( document.exitFullscreen ) {
document.exitFullscreen();
} else if (document['webkitExitFullscreen']) {
document['webkitExitFullscreen']();
} else if (document['mozCancelFullScreen']) {
document['mozCancelFullScreen']();
} else if (document['msExitFullscreen']) {
document['msExitFullscreen']();
}
this.isFullscreen = false;
}
}
export { VideoAds } from './ads.component';
......@@ -12,7 +12,7 @@
[style.line-height]="stageHeight + 'px'"
(mouseenter)="onMouseEnterStage()"
(mouseleave)="onMouseLeaveStage()"
(touchend)="showOverlays()"
(touchend)="showOverlaysOnTablet()"
>
<!-- LOADING PANEL -->
<div class="m-mediaModal__loadingPanel" *ngIf="isLoading">
......@@ -62,7 +62,7 @@
<!-- OVERLAY -->
<div class="m-mediaModal__overlayContainer"
*ngIf="showOverlay"
*ngIf="overlayVisible"
@fastFadeAnimation
>
<div class="m-mediaModal__overlayTitleWrapper">
......
......@@ -78,7 +78,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
isOpen: boolean = false;
isOpenTimeout: any = null;
showOverlay: boolean = false;
overlayVisible: boolean = false;
tabletOverlayTimeout: any = null;
routerSubscription: Subscription;
......@@ -261,8 +261,8 @@ export class MediaModalComponent implements OnInit, OnDestroy {
this.mediaHeight = this.entityHeight;
this.stageHeight = Math.max(this.mediaHeight, this.minStageHeight);
} else {
// Image is taller than stage; scale it down so it fits inside stage
// All videos should be as tall as possible but not taller than stage
// Either: Image is taller than stage; scale it down so it fits inside stage
// Or: Video should be as tall as possible but not taller than stage
this.mediaHeight = this.stageHeight;
}
......@@ -287,10 +287,8 @@ export class MediaModalComponent implements OnInit, OnDestroy {
const verticalShrinkWidthThreshold = this.mediaWidth + this.contentWidth + (this.padding * 4);
const widthDiff = verticalShrinkWidthThreshold - window.innerWidth;
// Is window narrow enough to start shrinking vertically?
if ( widthDiff >= 1 ) {
if (widthDiff >= 1) {
// What mediaHeight would be if it shrunk proportionally to difference in width
const mediaHeightPreview = Math.round((this.mediaWidth - widthDiff) / this.aspectRatio);
......@@ -324,7 +322,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
onFullscreenChange(event) {
this.calculateDimensions();
if ( !document.fullscreenElement &&
!document['webkitFullScreenElement'] &&
!document['webkitFullscreenElement'] &&
!document['mozFullScreenElement'] &&
!document['msFullscreenElement'] ) {
this.isFullscreen = false;
......@@ -340,10 +338,10 @@ export class MediaModalComponent implements OnInit, OnDestroy {
// If fullscreen is not already enabled
if ( !document['fullscreenElement'] &&
!document['webkitFullScreenElement'] &&
!document['webkitFullscreenElement'] &&
!document['mozFullScreenElement'] &&
!document['msFullscreenElement'] ) {
// Request full screen
// Request full screen
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem['webkitRequestFullscreen']) {
......@@ -392,7 +390,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
// Show overlay and video controls
onMouseEnterStage() {
this.showOverlay = true;
this.overlayVisible = true;
if (this.isVideo) {
// Make sure progress bar seeker is updating when video controls are visible
......@@ -401,9 +399,8 @@ export class MediaModalComponent implements OnInit, OnDestroy {
}
}
// Hide overlay and video controls
onMouseLeaveStage() {
this.showOverlay = false;
this.overlayVisible = false;
if (this.isVideo) {
// Stop updating progress bar seeker when controls aren't visible
......@@ -415,7 +412,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
// * TABLETS ONLY: SHOW OVERLAY & VIDEO CONTROLS * -------------------------------------------
// Briefly display title overlay and video controls when finished loading and stage touch
showOverlays() {
showOverlaysOnTablet() {
this.onMouseEnterStage();
if (this.tabletOverlayTimeout) {
......@@ -433,7 +430,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
this.isLoading = false;
if ( this.isTablet ) {
this.showOverlays();
this.showOverlaysOnTablet();
}
}
......
......@@ -2,6 +2,7 @@
* Sessions
*/
import { EventEmitter } from '@angular/core';
import * as Sentry from "@sentry/browser";
export class Session {
......@@ -56,8 +57,13 @@ export class Session {
});
}
if (window.Minds.user)
if (window.Minds.user) {
// Attach user_guid to debug logs
Sentry.setUser({
id: window.Minds.user.guid,
});
return window.Minds.user;
}
return false;
}
......
......@@ -11,6 +11,7 @@ export class SocketsService {
registered: boolean = false;
subscriptions: any = {};
rooms: string[] = [];
debug: boolean = false;
static _(session: Session, nz: NgZone) {
return new SocketsService(session, nz);
......@@ -58,20 +59,23 @@ export class SocketsService {
setUpDefaultListeners() {
this.socket.on('connect', () => {
this.nz.run(() => {
console.log(`[ws]::connected to ${this.SOCKET_IO_SERVER}`);
if (this.debug)
console.log(`[ws]::connected to ${this.SOCKET_IO_SERVER}`);
this.join(`${this.LIVE_ROOM_NAME}:${window.Minds.user.guid}`);
});
});
this.socket.on('disconnect', () => {
this.nz.run(() => {
console.log(`[ws]::disconnected from ${this.SOCKET_IO_SERVER}`);
if (this.debug)
console.log(`[ws]::disconnected from ${this.SOCKET_IO_SERVER}`);
this.registered = false;
});
});
this.socket.on('registered', (guid) => {
console.log('[ws]::registered');
if (this.debug)
console.log('[ws]::registered');
this.nz.run(() => {
this.registered = true;
this.socket.emit('join', this.rooms);
......@@ -87,7 +91,8 @@ export class SocketsService {
// -- Rooms
this.socket.on('rooms', (rooms: string[]) => {
console.log('rooms', rooms);
if (this.debug)
console.log('rooms', rooms);
this.nz.run(() => {
this.rooms = rooms;
});
......@@ -95,21 +100,24 @@ export class SocketsService {
this.socket.on('joined', (room: string, rooms: string[]) => {
this.nz.run(() => {
console.log(`[ws]::joined`, room, rooms);
if (this.debug)
console.log(`[ws]::joined`, room, rooms);
this.rooms = rooms;
});
});
this.socket.on('left', (room: string, rooms: string[]) => {
this.nz.run(() => {
console.log(`[ws]::left`, room, rooms);
if (this.debug)
console.log(`[ws]::left`, room, rooms);
this.rooms = rooms;
});
});
}
reconnect() {
console.log('[ws]::reconnect');
if (this.debug)
console.log('[ws]::reconnect');
this.registered = false;
this.socket.disconnect();
......@@ -119,7 +127,8 @@ export class SocketsService {
}
disconnect() {
console.log('[ws]::disconnect');
if (this.debug)
console.log('[ws]::disconnect');
this.registered = false;
this.socket.disconnect();
......
export const environment = {
production: true
production: true,
version: "VERSION",
};
......@@ -4,5 +4,6 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = {
production: false
production: false,
version: "VERSION",
};
......@@ -129,7 +129,8 @@
"blockchain" => (object) Minds\Core\Di\Di::_()->get('Blockchain\Manager')->getPublicSettings(),
"sale" => Minds\Core\Config::_()->get('blockchain')['sale'],
"last_tos_update" => Minds\Core\Config::_()->get('last_tos_update') ?: time(),
"tags" => Minds\Core\Config::_()->get('tags') ?: []
"tags" => Minds\Core\Config::_()->get('tags') ?: [],
"environment" => getenv('MINDS_ENV') ?: 'development',
];
if(Minds\Core\Session::isLoggedIn()){
......