Skip to content

Commit 774b859

Browse files
authored
Merge pull request #2400 from crazyserver/MOBILE-3401
Mobile 3401
2 parents 8f85933 + b8cc0e4 commit 774b859

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

scripts/mirror.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
source "scripts/functions.sh"
33

44
npm run build --bailOnLintError true --typeCheckOnLint true
5+
if [ $? -ne 0 ]; then
6+
exit 1
7+
fi
58

69
if [ -z $GIT_ORG_PRIVATE ] || [ -z $GIT_TOKEN ]; then
710
print_error "Env vars not correctly defined"

src/core/login/login.scss

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,8 @@ ion-app.app-root page-core-login-site {
9393
}
9494

9595
.core-login-site-logo {
96-
margin-top: 5px;
97-
margin-bottom: 5px;
98-
img {
99-
width: 90%;
100-
max-width: 300px;
101-
}
96+
width: 90%;
97+
max-width: 300px;
98+
margin: 5px auto;
10299
}
103100
}

src/core/login/pages/credentials/credentials.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div text-wrap text-center margin-bottom>
1515
<div class="core-login-site-logo">
1616
<!-- Show site logo or a default image. -->
17-
<img *ngIf="logoUrl" [src]="logoUrl" role="presentation">
17+
<img *ngIf="logoUrl" [src]="logoUrl" role="presentation" onError="this.src='assets/img/login_logo.png'">
1818
<img *ngIf="!logoUrl" src="assets/img/login_logo.png" role="presentation">
1919
</div>
2020

src/core/login/pages/reconnect/reconnect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<div class="core-login-site-logo" *ngIf="!showSiteAvatar">
1616
<!-- Show site logo or a default image. -->
17-
<img *ngIf="logoUrl" [src]="logoUrl" core-external-content [siteId]="siteId" role="presentation">
17+
<img *ngIf="logoUrl" [src]="logoUrl" role="presentation" onError="this.src='assets/img/login_logo.png'">
1818
<img *ngIf="!logoUrl" src="assets/img/login_logo.png" role="presentation">
1919
</div>
2020

src/core/login/pages/reconnect/reconnect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ export class CoreLoginReconnectPage {
105105
// Check logoURL if user avatar is not set.
106106
if (this.site.avatar.startsWith(site.infos.siteurl + '/theme/image.php')) {
107107
this.showSiteAvatar = false;
108-
this.logoUrl = this.loginHelper.getLogoUrl(config);
109108
}
109+
this.logoUrl = this.loginHelper.getLogoUrl(config);
110110

111111
this.getDataFromConfig(this.siteConfig);
112112
}).catch(() => {

src/core/login/pages/site/site.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ ion-app.app-root page-core-login-site {
5454
&.hidden {
5555
opacity: 0;
5656
visibility: hidden;
57-
margin: 0;
57+
margin-top: 0;
58+
margin-bottom: 0;
5859
padding: 0;
5960
max-height: 0;
6061
}

src/providers/ws.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
import { Injectable } from '@angular/core';
16+
import { Platform } from 'ionic-angular';
1617
import { HttpClient, HttpResponse } from '@angular/common/http';
1718
import { TranslateService } from '@ngx-translate/core';
1819
import { FileTransfer, FileUploadOptions } from '@ionic-native/file-transfer';
@@ -156,12 +157,15 @@ export class CoreWSProvider {
156157
protected fileProvider: CoreFileProvider,
157158
protected fileTransfer: FileTransfer,
158159
protected mimeUtils: CoreMimetypeUtilsProvider,
159-
logger: CoreLoggerProvider) {
160+
logger: CoreLoggerProvider,
161+
platform: Platform) {
160162
this.logger = logger.getInstance('CoreWSProvider');
161163

162-
if (this.appProvider.isMobile()) {
163-
(<any> cordova).plugin.http.setHeader('User-Agent', navigator.userAgent);
164-
}
164+
platform.ready().then(() => {
165+
if (this.appProvider.isMobile()) {
166+
(<any> cordova).plugin.http.setHeader('User-Agent', navigator.userAgent);
167+
}
168+
});
165169
}
166170

167171
/**

0 commit comments

Comments
 (0)