how to remove the coupling of st.sessionstate from handlerepo_url function [code]
- User
how to remove the coupling of st.session_state from handle_repo_url function
codedef handle_repo_url(data: AppManager) : repo_url = st.session_state.repo_url if not repo_url: return if repo_url != data.repo_url: repo_path = f"cloned_repos/{repo_url.split('/')[-1]}" data.update_and_reset(repo_url=repo_url) data.update(repo_path=repo_path) st.session_state.file_path = None st.session_state.method_name = None else: repo_path = data.repo_path if os.path.isdir(repo_path): data.repo_cloned = True return if "username" not in st.session_state and "password" not in st.session_state: stc.get_username_password() else: clone_output = clone_repository( repo_url, repo_path, st.session_state.username, st.session_state.password, ) if clone_output: data.repo_cloned = True logger.info("Repository Cloning : Success !") else: logger.error("Repository Cloning : Error !") stc.toast("Repository Cloning : Error !", type="error") repo_url = repo_url_col.text_input( "Enter BitBucket repo link here:", value=st.session_state.app.repo_url, key="repo_url", on_change=handle_repo_url, args=(st.session_state.app,), ) - Assistant