replace less variables
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
@import "../../../../../styles/styles";
|
||||
|
||||
.list-item {
|
||||
padding: 5px 20px;
|
||||
display: grid;
|
||||
@@ -14,7 +12,7 @@
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: @primary-color;
|
||||
background: var(--primary-color);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,21 +40,14 @@ export class ShowSongService {
|
||||
public list = (showId: string): Promise<ShowSong[]> => firstValueFrom(this.list$(showId));
|
||||
|
||||
public async delete$(showId: string, showSongId: string, index: number): Promise<void> {
|
||||
const [showSong, show] = await Promise.all([
|
||||
this.read(showId, showSongId),
|
||||
firstValueFrom(this.showService.read$(showId)),
|
||||
]);
|
||||
const [showSong, show] = await Promise.all([this.read(showId, showSongId), firstValueFrom(this.showService.read$(showId))]);
|
||||
if (!show) return;
|
||||
if (!showSong) return;
|
||||
|
||||
const order = [...show.order];
|
||||
order.splice(index, 1);
|
||||
|
||||
await Promise.all([
|
||||
this.showSongDataService.delete(showId, showSongId),
|
||||
this.showService.update$(showId, {order}),
|
||||
this.userService.decSongCount(showSong.songId),
|
||||
]);
|
||||
await Promise.all([this.showSongDataService.delete(showId, showSongId), this.showService.update$(showId, {order}), this.userService.decSongCount(showSong.songId)]);
|
||||
}
|
||||
|
||||
public update$ = async (showId: string, songId: string, data: Partial<ShowSong>): Promise<void> => await this.showSongDataService.update$(showId, songId, data);
|
||||
|
||||
@@ -30,11 +30,7 @@ export class ShowService {
|
||||
() => this.showDataService.list$,
|
||||
(user: User | null, shows: Show[]) => ({user, shows})
|
||||
),
|
||||
map(s =>
|
||||
s.shows
|
||||
.filter(show => !show.archived)
|
||||
.filter(show => show.published || (show.owner === s.user?.id && !publishedOnly))
|
||||
)
|
||||
map(s => s.shows.filter(show => !show.archived).filter(show => show.published || (show.owner === s.user?.id && !publishedOnly)))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user