Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Nov 21, 2024
1 parent 37a411b commit 9137fc6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/elements/clock/clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ class SbbClockElement extends LitElement {
/** Callback function for minutes hand. */
private _moveMinutesHandFn = (): void => this._moveMinutesHand();

protected override async willUpdate(changedProperties: PropertyValues<this>): Promise<void> {
protected override willUpdate(changedProperties: PropertyValues<this>): void {
super.willUpdate(changedProperties);

if (!isServer && changedProperties.has('now')) {
await this._startOrConfigureClock();
this._startOrConfigureClock();
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/elements/flip-card/flip-card-summary/flip-card-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class SbbFlipCardSummaryElement extends LitElement {
@property({ attribute: 'image-alignment', reflect: true })
public accessor imageAlignment: SbbFlipCardImageAlignment = 'after';

protected override willUpdate(_changedProperties: PropertyValues): void {
super.willUpdate(_changedProperties);
protected override willUpdate(changedProperties: PropertyValues<this>): void {
super.willUpdate(changedProperties);

if (_changedProperties.has('imageAlignment')) {
if (changedProperties.has('imageAlignment')) {
this.closest?.('sbb-flip-card')?.setAttribute('data-image-alignment', this.imageAlignment);
}
}
Expand Down
11 changes: 4 additions & 7 deletions src/elements/icon/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ import { html, type PropertyValues, type TemplateResult } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';

import { forceType, omitEmptyConverter } from '../core/decorators.js';
import { SbbUpdateSchedulerMixin } from '../core/mixins.js';

import { SbbIconBase } from './icon-base.js';

/**
* It displays an icon loaded from a registered namespace.
* Displays an icon loaded from a registered namespace.
*/
export
@customElement('sbb-icon')
class SbbIconElement extends SbbUpdateSchedulerMixin(SbbIconBase) {
class SbbIconElement extends SbbIconBase {
/**
* We need to additionally observe the svgicon attribute
* for sbb-angular compatibility.
Expand Down Expand Up @@ -56,13 +55,11 @@ class SbbIconElement extends SbbUpdateSchedulerMixin(SbbIconBase) {
return super.fetchSvgIcon(namespace, name);
}

protected override async willUpdate(changedProperties: PropertyValues<this>): Promise<void> {
protected override willUpdate(changedProperties: PropertyValues<this>): void {
super.willUpdate(changedProperties);

if (changedProperties.has('name') && this.name) {
this.startUpdate();
await this.loadSvgIcon(this.name);
this.completeUpdate();
this.loadSvgIcon(this.name);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/elements/table/table-wrapper/table-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SbbTableWrapperElement extends SbbNegativeMixin(LitElement) {
});
private _tableWrapper!: HTMLElement;

protected override firstUpdated(changedProperties: PropertyValues): void {
protected override firstUpdated(changedProperties: PropertyValues<this>): void {
super.firstUpdated(changedProperties);
this._tableWrapper = this.shadowRoot!.querySelector<HTMLElement>('.sbb-table-wrapper')!;
this._resizeObserver.observe(this._tableWrapper);
Expand Down

0 comments on commit 9137fc6

Please sign in to comment.