mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-26 17:59:26 +00:00
fix lint issues and errors
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
2749220832
commit
0820866bb8
3 changed files with 11 additions and 9 deletions
|
@ -82,6 +82,7 @@ import { ICurrentUser, ICurrentUserRole } from '@/types/current-user.model';
|
|||
import Logo from '@/components/Logo.vue';
|
||||
import SearchField from '@/components/SearchField.vue';
|
||||
import { RouteName } from '@/router';
|
||||
import { GraphQLError } from 'graphql';
|
||||
|
||||
@Component({
|
||||
apollo: {
|
||||
|
|
|
@ -310,17 +310,18 @@ export default class EditIdentity extends Vue {
|
|||
}
|
||||
|
||||
private async buildVariables() {
|
||||
const oldAvatarFile = await buildFileFromIPicture(this.identity.avatar);
|
||||
const oldAvatarFileContent = await readFileAsync(oldAvatarFile);
|
||||
const newAvatarFileContent = await readFileAsync(this.avatarFile);
|
||||
|
||||
const avatarObj = buildFileVariable(this.avatarFile, 'avatar', `${this.identity.preferredUsername}'s avatar`);
|
||||
const res = Object.assign({}, this.identity, avatarObj);
|
||||
/**
|
||||
* If the avatar didn't change, no need to try reuploading it
|
||||
*/
|
||||
if (oldAvatarFileContent === newAvatarFileContent) {
|
||||
res.avatar = {};
|
||||
if (this.identity.avatar) {
|
||||
const oldAvatarFile = await buildFileFromIPicture(this.identity.avatar) as File;
|
||||
const oldAvatarFileContent = await readFileAsync(oldAvatarFile);
|
||||
const newAvatarFileContent = await readFileAsync(this.avatarFile as File);
|
||||
if (oldAvatarFileContent === newAvatarFileContent) {
|
||||
res.avatar = null;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ import { IConfig } from '@/types/config.model';
|
|||
},
|
||||
})
|
||||
export default class Home extends Vue {
|
||||
events: Event[] = [];
|
||||
events: IEvent[] = [];
|
||||
locations = [];
|
||||
city = { name: null };
|
||||
country = { name: null };
|
||||
|
@ -225,8 +225,8 @@ export default class Home extends Vue {
|
|||
}
|
||||
|
||||
get filteredFeaturedEvents() {
|
||||
if (this.currentUser.isLoggedIn === false || !this.currentActor.id) return this.events;
|
||||
return this.events.filter(event => event.organizerActor.id !== this.currentActor.id);
|
||||
if (!this.currentUser.isLoggedIn || !this.currentActor.id) return this.events;
|
||||
return this.events.filter(event => event.organizerActor && event.organizerActor.id !== this.currentActor.id);
|
||||
}
|
||||
|
||||
geoLocalize() {
|
||||
|
|
Loading…
Reference in a new issue