Jammming project

Hi!
im almost done with the Jammming project and i am trying to debugg some things before i feel finished.
When i am pressing the “save to Spotify” button without having any tracks saved in the playlist i am getting this error:

TypeError: Cannot read property 'then' of undefined!

savePlaylist(){
    
    const trackURIs = this.state.playlistTracks.map(track => track.uri);
    **Spotify.savePlaylist(this.state.playlistName, trackURIs)**
    .then(() => {
      this.setState({
        playlistName: 'new playlist',
        playlistTracks: [],
      });
    });
  }

--------------------------------
savePlaylist(playlistName, trackURIs){
        
        if(!playlistName || !trackURIs.length){
            alert('no playlistname / no tracks in playlist');
            return;
        }
        const accessToken = Spotify.getAccessToken();
        const headers = {Authorization: `Bearer ${accessToken}`};
        let userId;

        return fetch('https://api.spotify.com/v1/me', {headers: headers})
        .then(response => {
            if(response.ok){
                return response.json();
            } else {
                return;
            }
        })
        .then(jsonResponse => {
            userId = jsonResponse.id;

            return fetch(`https://api.spotify.com/v1/users/${userId}/playlists`, 
            {
                headers: headers,
                method: 'POST',
                body: JSON.stringify({name: playlistName})
            }).then(response => {
                if(response.ok){
                    return response.json();
                } else {
                    console.log('API request failed');
                }
            }).then(jsonResponse => {
                const playlistId = jsonResponse.id;

                return fetch(`https://api.spotify.com/v1/users/${userId}/playlists/${playlistId}/tracks`, 
                {
                    headers: headers,
                    method: 'POST',
                    body: JSON.stringify({uris: trackURIs})
                })
            })
        })
    }
``
When i have some tracks in the playlist and rename it it works almost as intended. the playlist gets saved to spotify but the "setState" in the .then() after the call in the app.js doesnt clear the name of the tracklist.

Best regards

Solved the Error message by not chaining the .then this.setState.
But after a search or playlistSave it still doesnt clear the inputfield.
the state is changed but the inputfield doesnt change.