mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-16 02:18:16 -07:00
Merge pull request #4641 from sttatusx/fix-some-of-the-code-smells
This commit is contained in:
commit
6c101c5989
@ -143,7 +143,7 @@ const UserParentalControl: FunctionComponent = () => {
|
||||
|
||||
for (const btnDelete of accessScheduleList.querySelectorAll('.btnDelete')) {
|
||||
btnDelete.addEventListener('click', function () {
|
||||
const index = parseInt(btnDelete.getAttribute('data-index') || '0', 10);
|
||||
const index = parseInt(btnDelete.getAttribute('data-index') ?? '0', 10);
|
||||
schedules.splice(index, 1);
|
||||
const newindex = schedules.filter(function (i: number) {
|
||||
return i != index;
|
||||
|
@ -102,7 +102,7 @@ const UserProfile: FunctionComponent = () => {
|
||||
const target = evt.target as HTMLInputElement;
|
||||
const file = (target.files as FileList)[0];
|
||||
|
||||
if (!file || !file.type.match('image.*')) {
|
||||
if (!file || !/image.*/.exec(file.type)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ const ServerContentPage: FunctionComponent<ServerContentPageProps> = ({ view })
|
||||
|
||||
viewManager.tryRestoreView(viewOptions)
|
||||
.catch(async (result?: RestoreViewFailResponse) => {
|
||||
if (!result || !result.cancelled) {
|
||||
if (!result?.cancelled) {
|
||||
const apiClient = ServerConnections.currentApiClient();
|
||||
|
||||
// Fetch the view html from the server and translate it
|
||||
|
@ -179,7 +179,7 @@ export class AlphaPicker {
|
||||
|
||||
if (item) {
|
||||
const prefix = item.getAttribute('data-prefix');
|
||||
if (prefix && prefix.length) {
|
||||
if (prefix?.length) {
|
||||
itemFocusValue = prefix[0];
|
||||
if (itemFocusTimeout) {
|
||||
clearTimeout(itemFocusTimeout);
|
||||
|
Loading…
Reference in New Issue
Block a user